P
P
Petr Volkhanov2015-05-25 23:46:12
Apache HTTP Server
Petr Volkhanov, 2015-05-25 23:46:12

How to properly configure Apache in my case?

There is a VPS on which LAMP is installed. And only 2 directories wp1 and wp2. I need to bind the site.com domain to the wp1 folder, and site.ru to the wp2 folder. But at the domain registrar, I can only register the IP address of the VPS. I can't insert an entry like 105.170.98.108/wp1/. How do I properly configure Apache in my case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Luponos, 2015-05-26
@eprivalov

We take the apache config. If I had written the OS, I would have answered a little more precisely. In the config we write

NameVirtualHost *
Include sites-enabled/

In the directory with the Apache config file, create the sites-enabled directory;
in it, create virtual host files of the form:
/sites-enabled# cat domain.ru

<VirtualHost *>

        ServerName ИмяДоменаN
        ServerAlias www.ИмяДоменаN
        DocumentRoot /var/www/vhosts/ИмяДоменаN/httpdocs/
        <Directory />
                        Options FollowSymLinks
                        DirectoryIndex index.php
                        AllowOverride All
        </Directory>

        AccessFileName .htaccess


        ErrorLog /var/www/vhosts/ИмяДоменаN/logs/error.log
        CustomLog /var/www/vhosts/ИмяДоменаN/logs/access.log vhost_combined

</VirtualHost>

one file - one domain.
PS. I advise you to use special content management systems such as ISPanel or EHCP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question