Answer the question
In order to leave comments, you need to log in
How to set the /public home directory for a Laravel site that is hosted on a subdomain?
Good evening. I rented VDS virtual hosting on OS: Ubuntu 16.04 with IspManager 5 Lite installed. Then I created a WWW-domain in the control panel and linked my domain there. In the autosubdomain settings, I chose "In a separate directory".
On the server, I created a folder "/var/www/www-root/data/www/lulzslab.ru", where lulzslab.ru is my domain. In the www folder (before the lulzslab.ru folder), I created the dream.lulzslab.ru subdomain (this is the name of the folder on the server). I have already uploaded my site files to Laravel there. The fact is that all the public files of the site are located in the /public folder (this is how Laravel works) and in order for me to open these files on the site, I need to go to dream.lulzslab.ru/public, respectively, and I want to avoid having to go to this folder, and that it was the home directory, so I created a new config in the /etc/apache2/sites-available folder called "dream.lulzslab.ru.conf", then loaded the following content there:
<VirtualHost *:80>
ServerName dream.lulzslab.ru
ServerAdmin [email protected]
DocumentRoot /var/www/www-root/data/www/dream.lulzslab.ru/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/www-root/data/www/dream.lulzslab.ru/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/dream.lulzslab.ru.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/dream.lulzslab.ru.access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question