简体   繁体   中英

Apache2 fail in Linux Mint 17 KDE

  • I am with Linux the 5th day only.
  • I am used to XAMPP based projects in Windows, where everything is out-of-box and easy.
  • But unreadable cyrillic letters in GitBash (when typing ls -la ), file names no longer, than 256 symbols and absolutely non-secure access to non-public project folders forced me to switch to Linux Mint 17 KDE (Debian - Ubuntu fork).
  • After long searches in Internet I did all that is mentioned below.
  • I am absolutely frustrated with fact that when I type in browser address bar my first PHP script with <?php phpinfo(); inside ( http://site1/foo.php ) - everything is OK.
  • However the second (eg bar.php), the third (start.php) etc. scripts from the same folder - ERROR (no such file on server).
  • I made different sets of scripts in ~/server/site2 and ~/server/site3 and the necessary commands.
  • I made different parent folders (server2, html, sites).
  • I cleared Firefox cache.
  • The result is the same: the first script in a newly created folder is OK, - all the following ones - FAIL.

Any ideas?

Here is the code https://yadi.sk/d/Vi4VVho3bN3Ps

抱歉,我还没有评论功能,只是您可以在Linux上使用XAMPP,但是通常不建议在开发之外使用。

SOLVED. According to http://httpd.apache.org/docs/2.2/en/vhosts/ I needed Name-based Virtual Hosts (More than one web site per IP address) described here http://httpd.apache.org/docs/2.2/vhosts/name-based.html . For this I needed to uncomment or create NameVirtualHost *:80 directive in httpd.conf . However, here https://wiki.apache.org/httpd/DistrosDefaultLayout#Debian.2C_Ubuntu_.28Apache_httpd_2.x.29: is stated that debian based linux distros use two config files ( /etc/apache2/apache2.conf and /etc/apache2/ports.conf ) instead of classic httpd.conf one. Neither of my two config files had NameVirtualHost *:80 directive. Therefore, I created it in /etc/apache2/apache2.conf . This didn't work even after checking access rights to folders and files in my user folder (644 instead of 755 also OK) and sudo a2dissite site1.conf , sudo a2ensite site1.conf , service apache2 reload . I made PC reboot - and voila! - I see my virtual hosts in browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM