0

I'm running the following command:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/projecttest.com

and I am getting the following error:

cp: cannot stat ‘/etc/apache2/sites-available/default’: No such file or directory

What can I do to fix this?

1
  • 1
    How about ls /etc/apache2/sites-available ? I am guessing they changed the name from "default" to "000-default.conf"
    – Panther
    Nov 8, 2016 at 18:18

1 Answer 1

0

Check here instead... /etc/apache2/sites-available/000-default.conf

If it's still not available, you can recreate the file with the default contents.


<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
4
  • See help.ubuntu.com/lts/serverguide/httpd.html .
    – Panther
    Nov 8, 2016 at 18:21
  • I'm not sure I understand what your saying @bodhi.zazen
    – user508889
    Nov 8, 2016 at 18:23
  • The server guide may be helpful for the OP as I suspect s/he is following an old somewhat outdated server guide.
    – Panther
    Nov 8, 2016 at 18:30
  • Oh, agreed. :) @bodhi.zazen
    – user508889
    Nov 8, 2016 at 18:31

You must log in to answer this question.

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