1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

vhost.conf question

Discussion in 'Plesk for Linux - 8.x and Older' started by Amin Taheri, Jul 16, 2007.

  1. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    Hello guys,

    I have a question about vhost.conf file

    I have a domain, domain.com, which I want to have seperate settings.

    So I go to /var/vhosts/www/domain.com/conf and create a vhost.conf file

    In the file it has only

    Code:
    <VirtualHost Server_IP_Here:80>
    SecRuleRemoveByID 960015
    SecRuleRemoveByID 960034
    </VirtualHost>
    
    I restart apache after saving the file - server restarts fine, but the changes are not done.

    If I put these changes directly in httpd.include in the same directory and restart apache the changes work fine - so I know there are no problems with the command.

    I tried searching for something like this, but I didnt really find anything too terribly relevant, but its possible I missed something.
    Am I doing something wrong, or missing a step?

    Thanks in advance.
     
  2. faris

    faris Guest

    0
     
    I think you are using the wrong syntax.

    You should use

    <Directory /home/httpd/vhosts/somedomain.com/httpdocs>
    SecRuleRemoveById xxx
    SecRuleRemoveById xxx
    </Directory>

    The path above assumes your vhosts in in /home/httpd but on fresh installs of Plesk 8.x it would be /var/www/vhosts/domedomain.com/httpdocs


    Don't forget you then need to use
    websrvmng -u --vhost-name=somedomain.com

    then restart httpd
     
  3. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    Hi, thanks for the response. its still not working for me, perhaps you can tell me if I missed a step?

    I created a new file called vhost.conf and put it in the /var/www/vhosts/domain.com/httpdocs directory.

    The file contains the following (domain is real in the file though)

    Code:
    <Directory /var/www/vhosts/domain.com/httpdocs>
    SecRuleRemoveById xxx
    SecRuleRemoveById xxx
    </Directory>
    
    I then ran
    Code:
    # /usr/local/psa/admin/bin/websrvmng -u --vhost-name=domain.com
    
    # /sbin/service httpd restart
    Stopping httpd:                           [  OK  ]
    Starting httpd:                                            [  OK  ]
    
    Still doesn't work :(
     
  4. faris

    faris Guest

    0
     
    Ah! vhost.conf needs to be in the /var/www/vhosts/domains.com/conf directory, not httpdocs.

    That's all that's wrong.

    You'll see in the same conf directory the main include files that Plesk adds to the apache conf for that domain. Do not edit those files as they get overwritten by plesk. You'll see an include in them for the vhost.conf file (and vhost_ssl.conf for https)

    Faris.
     
  5. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    heh ok - I guess I misread your instructions. I moved the file back to the conf directory and restarted apache, still no joy.

    Basically what I am doing in a nut shell is that I am removing two mod sec rules from a site. If I put those two rules into the httpd.include file for this domain and restart apache then it works as intended.

    At present it is still not working with the file in the conf directory. But its still not working :(

    Edit: I finally got it working, I forgot that I needed to do the websrvmng command twice - once for @none and once for www. :p

    Thanks for all your help, its appreciated :)
     
  6. faris

    faris Guest

    0
     
    I don't quite understand that. When you specify the domain after --vhost-name= that's just telling to to deal completely with the domain. It doesn't know about www and non-www it only knows about domain.com not www.domain.com if you see what I mean.

    I'm glad you got it working though! I've earned my Brownie points for the day.

    Faris.
     
  7. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    I understand, but it didnt work until I did it both.

    Either way, thank you much :)
     
Loading...