Титла: Настройка на апаче (subdomain)?
Публикувано от: heminei в Feb 15, 2011, 22:52
Здравейте! Как да настроя поддомейни на мой сървър? Ето ми конфиг файла: /etc/apache2/sites-available/default <VirtualHost *:80> ServerAdmin webmaster@localhost
DocumentRoot /media/site/site <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /media/site/site/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory>
</VirtualHost>
Предварително ви Благодаря! :)
Титла: Re: Настройка на апаче (subdomain)?
Публикувано от: romeo_ninov в Feb 15, 2011, 23:05
като начало е добре да прочетете документцията. Няма как и основния и виртуалния хост да слушат на един порт и всичко ИП адреси (без разграничение по име на хост)
Титла: Re: Настройка на апаче (subdomain)?
Публикувано от: heminei в Feb 16, 2011, 07:50
Това ми е ясно...
Искам да ми дадете пример как да направя: test.saitami.com да е saitami.com/test?
Да ми промените кода.. :)
Титла: Re: Настройка на апаче (subdomain)?
Публикувано от: b2l в Feb 16, 2011, 10:27
touch /etc/apache2/sites-available/test.site GeSHi (Apache configuration): <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName test.site.com DocumentRoot /media/site/site/test <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /media/site/site/test> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.test.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.test.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
a2ensite test.site apach2ctl restart
|