Check ls (for list ) or ll (list with details)
$ cd /etc/apache2/sites-available
$ ls
Now enter command $ cp 000-default.conf example.live.conf
(copy default file with new file with the same name domain name) if permission issue then use sudo
$ sudo nano example.live.conf
(for file edit and its content)
or use$ sudo gedit example.live.conf
for open file in editor.
# Change with project domain name which is set in /etc/hosts
ServerName example.live
# if use www then use serveralias (optional)
ServerAlias www.example.live
ServerAdmin [email protected]
# change with project path
DocumentRoot /var/www/html/example/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<Directory “/var/www”>
AllowOverride All
</Directory>
If we use folder outside the wamp/xamp
<VirtualHost *:80>
# Change with project domain name which is set in /etc/hosts
ServerName example.live
# if use www then use serveralias (optional)
ServerAlias www.example.live
ServerAdmin [email protected]
# change with project path
DocumentRoot /home/bitcot/Documents/example/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<Directory “/home/bitcot/Documents”>
AllowOverride All
</Directory>
Enable this virtual host or domain configuration:
$ sudo a2ensite wprock.local.conf
Server restart (if needed use sudo) :
$ systemctl reload apache2
Now goto project .env file: