Z
Z
zhdoon2019-05-08 12:11:06
ubuntu
zhdoon, 2019-05-08 12:11:06

How to set up a web server on Ubuntu + VestaCP?

Hello.
Installed Ubuntu 18.02 and installed VestaCP. The panel opens at https://localhost:8083/ I go in, add a new user, create a new domain, create a folder /home/user/web/mo.local/public_html/ I put index.php in it, but in the browser at mo .local site does not open. At the same time, it opens at 172.17.0.1
In Apache and Nginx configs:

<VirtualHost 172.17.0.1:8080>

    ServerName mo.local
    ServerAlias www.mo.local
    ServerAdmin [email protected]
    DocumentRoot /home/user/web/mo.local/public_html
    ScriptAlias /cgi-bin/ /home/user/web/mo.local/cgi-bin/
    Alias /vstats/ /home/user/web/mo.local/stats/
    Alias /error/ /home/user/web/mo.local/document_errors/
    #SuexecUserGroup user user
    CustomLog /var/log/apache2/domains/mo.local.bytes bytes
    CustomLog /var/log/apache2/domains/mo.local.log combined
    ErrorLog /var/log/apache2/domains/mo.local.error.log
    <Directory /home/user/web/mo.local/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/user/web/mo.local/public_html:/home/user/tmp
        php_admin_value upload_tmp_dir /home/user/tmp
        php_admin_value session.save_path /home/user/tmp
    </Directory>
    <Directory /home/user/web/mo.local/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid user user
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID user user
    </IfModule>

    IncludeOptional /home/user/conf/web/apache2.mo.local.conf*

</VirtualHost>

server {
    listen      172.17.0.1:80;
    server_name mo.local www.mo.local;
    error_log  /var/log/apache2/domains/mo.local.error.log error;

    location / {
        proxy_pass      http://172.17.0.1:8080;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
            root           /home/user/web/mo.local/public_html;
            access_log     /var/log/apache2/domains/mo.local.log combined;
            access_log     /var/log/apache2/domains/mo.local.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/user/web/mo.local/document_errors/;
    }

    location @fallback {
        proxy_pass      http://172.17.0.1:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/user/conf/web/nginx.mo.local.conf*;
}

How to make it possible to open sites by domain names?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moris Haos, 2019-05-11
@morihaos

Hi,
In order for sites to open by domain names, you need to configure the DNS service. Or, as already said, manually register hosts and their IPs in hosts. What to choose, DNS or hosts - depends on the number of sites, as well as the frequency of their appearance / creation / change / deletion, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question