Find the answer to your Linux question:
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 ...
  1. #1
    Just 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!

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    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
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Just Joined!
    Join Date
    Apr 2009
    Posts
    19
    Quote Originally Posted by b2bwild View Post
    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
    How can I make Apache2 serve the files in /home/mysite or in /var/www? do you mean to make /home/mysite as a virtual host?

  4. #4
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Yes you can create a virtual host for /home/mysite.
    btw, the path should be /home/username/mysite/, or mysite is the user?
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  5. #5
    Linux 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".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...