Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

this is my first experience using CentOS 5.7 / Linux as my web server OS and I have just finished installing Apache. Then I created a new account using WHM. The account is now created and the domain name can be accessed. I have put the web files under /home/user/public_html/ but when I access the domain assigned for that user which I assigned when creating new account in WHM, it doesn't read the files.

In /usr/local/apache/conf/httpd.conf :

<VirtualHost 175.103.48.66:80>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /home/user/public_html
ServerAdmin webmaster@domain.com
User veevou # Needed for Cpanel::ApacheConf
<IfModule mod_suphp.c>
suPHP_UserGroup group1 group1
</IfModule>
<IfModule !mod_disable_suexec.c>
SuexecUserGroup group1 group1
</IfModule>
CustomLog /usr/local/apache/domlogs/domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/
</VirtualHost>

Instead of reading from /home/user/public_html/ apache will read the /var/ww/html/ folder. How to set the apache so that when user access www.domain.com, they will access the files under /home/user/public_html/ ? Please advice. Thanks

share|improve this question
    
/usr/local/apache/conf/httpd.conf?! Is this a custom Apache install? –  Cristian Ciupitu May 12 at 2:57

2 Answers 2

Check that you have NameVirtualHost 175.103.48.66:80 before the VirtualHost definition.

To user domain/~user paths you need to have userdir module loaded:

LoadModule userdir_module libexec/apache2/mod_userdir.so

Please see http://httpd.apache.org/docs/2.1/mod/mod_userdir.html

share|improve this answer
    
I'm reading the docs, but will there be extra " ~ " at the end of www.domain.com ? like www.domain.com/~ ? Because it's what I get from the docs –  C.S.Putra Jan 19 '12 at 9:13
    
Sorry. Misread the question. Changed the answer accordingly. Please show what your apachectl -S command shows if that doesn't help. –  jkj Jan 19 '12 at 9:27
    
Thanks for the reply =) this is the output of apachectl -S : VirtualHost configuration: Syntax OK –  C.S.Putra Jan 19 '12 at 10:10
    
@C.S.Putra it doesn't show any virtualhosts. Try NameVirtualHost *:80 and <VirtualHost *:80>. –  jkj Jan 19 '12 at 10:38
    
Done it. And i have asked help from the technical support team to set the apache for me. Now it's working well. Thanks for your help =) –  C.S.Putra Jan 20 '12 at 7:24

I would imagine your issue is relating to permissions on the directory. cPanel will auto generate the apache configuration file so you need to use the /usr/local/cpanel/bin/apache_conf_distiller command if you are going to make changes to the configuration, you should however not need to do anything in that regard as the issue is most likely unrelated to the configuration and is related to permissions of your home directory.

Check out /usr/local/apache/logs/error_log when visiting the website to see what it says.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.