Chcę utworzyć virtualnego hosta sluby.dev dla, którego zawartość jest w katalogu: /home/piotr/public_html/slub/web
Pliki konfiguracyjne na czerwono rzeczy zmieniane/dodawane przez mnie w plikach które istniały wcześniej:
etc/hosts
Kod: Zaznacz cały
127.0.0.1 localhost
127.0.0.1 sluby.dev
127.0.1.1 piotr-desktop
Kod: Zaznacz cały
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAlias www.sluby.dev
ServerName sluby.dev
DocumentRoot /home/piotr/public_html/slub/web
DirectoryIndex app_dev.php
<Directory /home/piotr/public_html/slub/web >
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Custom log file locations
LogLevel warn
ErrorLog /home/piotr/public_html/slub/logs/error.log
CustomLog /home/piotr/public_html/slub/logs/access.log combined
</VirtualHost>
Kod: Zaznacz cały
sudo a2ensite sluby.dev
później
Kod: Zaznacz cały
sudo /etc/init.d/apache2 restart
/etc/apache2/sites-available/default
Kod: Zaznacz cały
<VirtualHost *:80>
DocumentRoot /home/piotr/public_html
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/piotr/public_html >
Options 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>
Kod: Zaznacz cały
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
#[color=#FF0000]Listen 192.168.1.114:80 -adres mojego komputera w lokalnej sieci[/color]
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
/etc/apache2/sites-available/apache2.conf
Kod: Zaznacz cały
# Include all the user configurations:
Include httpd.conf
# Include ports listing
Include ports.conf
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
Include conf.d/
# Include the virtual host configurations:
Include sites-enabled/
[color=#FF0000]ServerName sluby.dev[/color]