LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-09-2010, 02:40 AM   #1
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Rep: Reputation: 0
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
 
Old 08-09-2010, 03:48 AM   #2
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Original Poster
Rep: Reputation: 0
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
 
Old 08-09-2010, 03:57 AM   #3
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Original Poster
Rep: Reputation: 0
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
 
Old 08-09-2010, 04:13 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 08-09-2010, 09:11 PM   #5
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
 
Old 08-10-2010, 12:03 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
How did you make the symlink? I thought you used:
Code:
ln -s /home/user1/public_html /var/www/html
 
Old 08-11-2010, 12:51 AM   #7
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
 
Old 08-11-2010, 02:28 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 08-11-2010, 04:46 AM   #9
Ericxx
Member
 
Registered: Feb 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
 
Old 08-11-2010, 05:22 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change default Apache page? flamesrock Linux - Software 3 11-29-2004 05:31 PM
change default error page for apache linuxtesting2 Linux - Networking 2 09-26-2004 07:38 AM
how to change apache default page yenonn Linux - Networking 3 08-17-2004 10:27 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM
i cant change the default webpage to my own yoaliens3000 Mandriva 2 11-03-2003 07:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration