Results 1 to 5 of 5
I installed LAMP on an ubuntu server, the default directory for web pags is /var/www, I put some of html and php files in /var/www, they can be opened correctly ...
- 04-29-2009 #1Just Joined!
- Join Date
- Apr 2009
- Posts
- 19
Apache2 configuration problem
I installed LAMP on an ubuntu server, the default directory for web pags is /var/www, I put some of html and php files in /var/www, they can be opened correctly in a web browser if I tylped "h ttp://localhost".
Now there are some other web pages in /home/mysite/, I hope the web pages can be opened in web browser too if I type in "h ttp: //localhost/mysite", I don't know how to do it, changing DocumentRoot to /home doesn't work. Who could give some detailed examples? Thanks!
- 04-29-2009 #2
LOL,
, It wont work that way.
Put mysite folder in your /var/www/
but it will use the same configuration of /var/www/ root.
If you want to host different site, I suggest you to make a virtual host
- 04-30-2009 #3Just Joined!
- Join Date
- Apr 2009
- Posts
- 19
- 05-01-2009 #4
Yes you can create a virtual host for /home/mysite.
btw, the path should be /home/username/mysite/, or mysite is the user?
- 05-01-2009 #5Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 1,946
You should have an entry in your httpd.conf file of Apache under "User Directory" called public_html. The directory should already exist in your /home/user/ directory, if it doesn't, create it. Need the same entry in php.ini file which is usually under /etc/apache. To access the files in this directory you would type the user name with a tilde after the localhot/, such as "http://localhost/~username/file.php".


Reply With Quote
