-1

I am trying to change the /var/www/html default directory to /var/www/domain.com I have changed this in the httpd config file but it doesn't seem to work. I am running Centos 7 and Apache2

27
  • What is error you are getting? Commented Jun 13, 2016 at 3:46
  • cp: cannot stat ‘/etc/apache2/sites-available/default’: No such file or directory Commented Jun 13, 2016 at 3:54
  • I even tried changing the default to 000-default.conf and the same error Commented Jun 13, 2016 at 3:55
  • So then I went to /etc/ directory and there is no apache2 directory there? I don't know what is going on :( Commented Jun 13, 2016 at 3:56
  • 1
    CentOS has httpd config files in /etc/httpd, not /etc/apache2. (And they may or may not provide the sites-available scheme.) Commented Jun 13, 2016 at 7:36

1 Answer 1

0

As UlrichSchwartz commented, Debian/Ubuntu/etc uses package name apache2 with configuration in directory /etc/apache2 while RedHat/CentOS/etc uses package name httpd and config directory /etc/httpd, and does not provide the sites-enabled + a2ensite scheme by default, although you can construct it if you want.

If you want to change the (by default only one) doc root, just edit /etc/httpd/conf/httpd.conf. If you want to set up virtual hosts, so that for example http://example.com/ goes a different place (or places) than http://localhost/, then you get to decide whether you want to put them in the one config file, or split them out into several files in /etc/httpd/conf.d/ (note the dot dee). Often having each vhost in its own file is convenient, but this is by no means required.

PS: there is no Apache 1. /usr/sbin/apachectl is ctl as in charlie thomas lunatic, not one.

1
  • Thank you for this information. I will make the appropriate changes. Commented Jun 14, 2016 at 4:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.