Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wajdi's avatar
Level 2

create vhost apche2

How to create a local domain for a laravel application I'm using ubuntu 18.04 and apache2 So far I've edited my /etc/hosts and added this line

127.0.0.1   acilla

and in /etc/apache2/sites-availables I've created a new file called acilla.conf

<VirtualHost *:80>
    [email protected]
    ServerName acilla.dev
    ServerAlias www.acilla.dev
    DocumentRoot /var/www/html/acilla/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I've activated the new site using:

sudo a2dissite 000-default.conf
sudo a2ensite acilla.conf

and of course the project is created in /var/www/html with all permissions and contains .htaccess file Right now if I type http://acilla in a browser I get the default apache2 ubuntu homepage what I am missing ? Any help or fresh recent tutorial ?

0 likes
6 replies
NOMGUY's avatar
NOMGUY
Best Answer
Level 16
127.0.0.1   acilla.dev
wajdi's avatar
Level 2

@NOMGUY Yes thank you, I just did the reverse by removing .dev

1 like
automica's avatar

Don’t forget you can also use the artisan serve to get a local development environment running without needing to touch apache.

wajdi's avatar
Level 2

@brightstormhq Thanks but I like to do my own stuff since I'm creating projects inside the document root directory /var/www/html

esorone's avatar

FYI, You still can use php artisan serve in your document route.

Kr

Please or to participate in this conversation.