# apt-get update # apt-get install apache2 これで,必要なものは全て入る.
# emacs /etc/apache2/apache2.conf
# <Directory /> # Options FollowSymLinks # AllowOverride None # Require all denied # </Directory> # <Directory /usr/share> # AllowOverride None # Require all granted # </Directory> # <Directory /var/www/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted # </Directory> #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory>
<Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www> # <Directory /home/kouhou/public_html> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place # RedirectMatch ^/$ /apache2-default/ </Directory> <Directory "/home/cosmo/public_html/master"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi </Directory> <Directory "/home/cosmo/public_html/enroll"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi </Directory> <Directory "/home/cosmo/public_html/new"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi </Directory> <Directory "/home/cosmo/public_html/report"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi </Directory> <Directory "/home/cosmo/public_html/seminar"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi </Directory>
#CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
# Alias /icons/ "/usr/share/apache2/icons/" # <Directory "/usr/share/apache2/icons"> # Options FollowSymlinks # AllowOverride None # Require all granted # </Directory> 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>
# emacs /etc/apache2/site-available/000-default.conf
#NameVirtualHost 133.50.160.51:80 NameVirtualHost 133.50.160.53:80 #<VirtualHost 133.50.160.51:80> <VirtualHost 133.50.160.53:80> #<VirtualHost *:80> ServerAdmin epwww@ep.sci.hokudai.ac.jp ServerName www.ep.sci.hokudai.ac.jp DocumentRoot /var/www 入れ替え時にコメントアウト # DocumentRoot /home/kouhou/public_html ←入れ替え時にコメントアウトを外す ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On </VirtualHost> #NameVirtualHost 133.50.160.51:80 #<VirtualHost 133.50.160.51:80> <VirtualHost 133.50.160.53:80> ServerName www.cosmo.sci.hokudai.ac.jp ServerAdmin epwww@ep.sci.hokudai.ac.jp DocumentRoot /home/cosmo/public_html # DocumentRoot /var/www ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On </VirtualHost>
<IfDefine ENABLE_USR_LIB_CGI_BIN> # ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ # <Directory "/usr/lib/cgi-bin"> # AllowOverride None # Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch # Require all granted # </Directory> ScriptAlias /cgi-bin/ "/home/cgi-bin/" <Directory "/cgi-bin"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks </Directory> ScriptAlias /inex/cgi-bin/ "/home/inex/cgi-bin/" <Directory "/inex/cgi-bin"> AllowOverride AuthConfig Limit Options ExecCGI FollowSymLinks </Directory> </IfDefine>
# /etc/init.d/apache2 restart Restarting web server: apache2[ TIME ] [warn] NameVirtualHost *:80 has no VirtualHosts ... waiting .[ TIME ] [warn] NameVirtualHost *:80 has no VirtualHosts
設定ファイルはここを参照.
# a2enmod userdir[補足]
# a2enmod dir
# /etc/init.d/apache2 restart
http://sango.ep.sci.hokudai.ac.jp.
にアクセスし,It works! と表示されれば起動テストとしては成功
2017/03/31 (須藤 康平) | Copyright © 2017 epcore |