The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help Please

Discussion in 'General Discussion' started by vietkool, Dec 15, 2004.

  1. vietkool

    vietkool Active Member

    Joined:
    May 17, 2004
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    Got a new server with Cpanel Pro, configured everything work great but I have just on little problem don't know why. I create a new account with a domain let say mydomain.com.
    when using http://mydomain.com it works great but when I use http://www.mydomain.com then it can'nt find the domain at all . For some reason it didn't recognized a "www" infront fo the domain.
    Is there anything else I have to configure from WHM or elsewhere ?
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Make sure you have a ServerAlias statement in /usr/local/cpanel/conf/httpd.conf for the domain that includes "my.domain.com" and also "www.mydomain.com".
     
  3. vietkool

    vietkool Active Member

    Joined:
    May 17, 2004
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    I never do the configuration thru SSH, so please if you may want to step by step show me how to do it by using command line to edit Apache config file


    thanks
     
  4. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Assuming you are at a root prompt thru SSH.
    1. Change to the directory: cd /usr/local/apache/conf
    2. Make a copy of httpd.conf: cp httpd.conf httpd-original.conf
    3. Edit the file: pico httpd.conf (you can also use nano or vi)
    4. Scroll down the file until you see a Virtual Host entry for the domain in question.
    5. Look for the ServerAlias directive.
    6. Add the "www.mydomain.com".
    7. Assuming pico - Ctrl-o to write the file - Then Ctrl-x to exit.
    8. Double check that the httpd.conf file has no syntax errors: /etc/rc.d/init.d/httpd configtest
    9. Restart Apache: service httpd restart
    If you get lost/confused just re-use the backup copy of httpd.conf.
     
  5. vietkool

    vietkool Active Member

    Joined:
    May 17, 2004
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    I got it .. thanks alot ...

    Now I need to put some security in my php.ini file ... how do I do that ?
     
  6. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    That is somewhat more complicated than fixing the ServerAlias directive. Same editing techniques apply though. Would be worth your while to understand the ramifications of adding security to php. Here are a couple of links that can get you started.
    http://www.webhostgear.com/166.html
    http://tinyurl.com/5rfuh
     
Loading...

Share This Page