D
D
Danila2016-09-18 11:41:50
Apache HTTP Server
Danila, 2016-09-18 11:41:50

How to create an apache 2 subfolder?

Hello! There was a need to create a virtual host (namely a host) with an address like www.site.ru/dir Apache2
config:

<VirtualHost *:80>
 #u
 ServerName redcap52.ru/udir
 ServerAlias www.redcap52.ru/udir
 ServerAdmin [email protected]
 DocumentRoot /var/www/udir
 ErrorLog ${APACHE_LOG_DIR}/error_u.log
 CustomLog ${APACHE_LOG_DIR}/access_u.log combined
</VirtualHost>

But on transition it throws a 404 error. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-09-18
@alsopub

Because the construction

ServerName redcap52.ru/udir
ServerAlias www.redcap52.ru/udir
is not allowed.
You need to configure <Directory>in the block where ServerName redcap52.ru
Look at web-programming.com.ua/nastrojka-virtualhost-na-apache2 about Alias.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question