LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Change default Apache webpage to a user home page (https://www.linuxquestions.org/questions/linux-server-73/change-default-apache-webpage-to-a-user-home-page-825041/)

Ericxx 08-09-2010 02:40 AM

Change default Apache webpage to a user home page
 
Dear all,

I am now using CentOS5 as the server providing Apache services. I have managed to setup the web page under /home/user1/public_html, now I wish to change the default web page of our server to /home/user1/public_html. i tried to modify httpd.conf, in which i changed the "/var/www/" to the above user directory, but didnot work. Please kindly suggest. Thank you.

Regards,
Eric

Ericxx 08-09-2010 03:48 AM

Hello,

I managed to realize it by making a symbolic link between my user home directory and /var/www/html. And now it works. Appreciate any comments on this methods.

Eric

Ericxx 08-09-2010 03:57 AM

Hello,

here comes a new problem. How can i make sure the update in my user directory can immediately be synchronized to /var/www/html? Thanks.

Eric

bathory 08-09-2010 04:13 AM

Hi,

Since you use a symlink, from /home/user1/public_html to /var/www/html there is no problem at all.
Editing a file in /home/user1/public_html is the same as editing it at /var/www/html
Read here the definition of symlink

Ericxx 08-09-2010 09:11 PM

Quote:

Originally Posted by bathory (Post 4060504)
Hi,

Since you use a symlink, from /home/user1/public_html to /var/www/html there is no problem at all.
Editing a file in /home/user1/public_html is the same as editing it at /var/www/html
Read here the definition of symlink

Thanks, bathory. But now it seems if adding a new file in my user directory, then /var/www/html can not see this add-file update.. Any configurations I need to fix? Thanks.

Eric

bathory 08-10-2010 12:03 AM

How did you make the symlink? I thought you used:
Code:

ln -s /home/user1/public_html /var/www/html

Ericxx 08-11-2010 12:51 AM

Quote:

Originally Posted by bathory (Post 4061336)
How did you make the symlink? I thought you used:
Code:

ln -s /home/user1/public_html /var/www/html

Thanks. I used * appending in the src directory:
#ln -s /home/user1/public_html/* /var/www/html

wondering if the hidden files under public_html would affect the update in /var/www/html.

Thanks,
Eric

bathory 08-11-2010 02:28 AM

Quote:

Thanks. I used * appending in the src directory:
#ln -s /home/user1/public_html/* /var/www/html
This way, if you add a new file or directory in /home/user1/public_html, it won't be reflected in /var/www.html

Ericxx 08-11-2010 04:46 AM

Quote:

Originally Posted by bathory (Post 4062662)
This way, if you add a new file or directory in /home/user1/public_html, it won't be reflected in /var/www.html

I just removed the link and tried with "ln -s /home/user1/public_html/ /var/www/html", then created a new "test.txt" in /home/user1/public_html/, the link update still cannot be updated in /var/www/html. Please suggest. Thanks.

Eric

bathory 08-11-2010 05:22 AM

What is the output of:
Code:

ls -ld /var/www/html
Since you're running Centos in could be a SELinux problem. Try to disable it and see if the directory var/www/html gets updated


All times are GMT -5. The time now is 12:01 AM.