0

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 [email protected]
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

1
  • /usr/local/apache/conf/httpd.conf?! Is this a custom Apache install? May 12, 2014 at 2:57

2 Answers 2

1

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

5
  • 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, 2012 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, 2012 at 9:27
  • Thanks for the reply =) this is the output of apachectl -S : VirtualHost configuration: Syntax OK
    – C.S.Putra
    Jan 19, 2012 at 10:10
  • @C.S.Putra it doesn't show any virtualhosts. Try NameVirtualHost *:80 and <VirtualHost *:80>.
    – jkj
    Jan 19, 2012 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, 2012 at 7:24
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .