6

I'm trying to set up my new Redhat server and I have Apache config in my /etc/httpd/sites-enabled folder, but when I run /usr/sbin/httpd -S as root to check the syntax, it just returns:

    [root@511863-web3 sites-enabled]# /usr/sbin/httpd -S
    VirtualHost configuration:
    Syntax OK

So it doesn't look like it's detecting it. Since it's a new server, am I missing some sort of configuration? I restarted httpd, but my site still doesn't work.

1
  • 4
    You say this is a Redhat server, but you're using a directory called 'sites-enabled'... are you sure you're using RHEL? That's a debian/ubuntu-style directory structure, and won't do anything on RHEL. RHEL systems can have configuration fragments in /etc/httpd/conf.d, however.
    – jsbillings
    Commented Mar 15, 2014 at 22:03

2 Answers 2

4

Your main config (httpd.conf or apache2.conf) should have a line that will include the sites-enabled directory.

# Include the virtual host configurations: 
Include sites-enabled/

If it is not there, add it near the end, and reload apache.

2

You need to follow some steps, like there must be one more directory named as sites-available in /etc/httpd. So you need to create a file with any name in sites-available and then you need to run below command. No need to use .conf as an extension for this file.

$ a2ensite (your file name)

for example, suppose you have created a file named as abc then your command must be

$ a2ensite abc

This command will create a symbolic link in /etc/httpd/site-enabled directory. Then you can run a command to check syntax and get that site up on your browser.

1
  • 1
    I already have a symlink in my sites-enabled that points to that configuration file in my sites-available.
    – bigpotato
    Commented Aug 27, 2013 at 19:42

You must log in to answer this question.

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