ラベル Apache2 の投稿を表示しています。 すべての投稿を表示
ラベル Apache2 の投稿を表示しています。 すべての投稿を表示

2014年2月20日木曜日

36 - GeoEXT を使用した WFS-T 8 - GeoServer ドメイン表示の変更

36-8 GeoServer ドメイン表示の変更
「36-4 Grid の表示」でも「GeoExt.data.WMSCapabilitiesStore」の url の設定が出来ませんでした。ここでも同じ設定をするので、GISTutor の Configuring GeoServer Proxy for Public and Remote Data Access(http://www.gistutor.com/geoserver/21-intermediate-geoserver-tutorials/38-configuring-geoserver-proxy-for-public-and-remote-data-access.html)を参考に、 Apache の設定を修正してみます。

proxy モジュールを有効にします。
確認するには mod-enabled を見てみます。

root@debian7-vmw:~# ls /etc/apache2/mods-enabled/
alias.conf            authz_user.load  dir.load          php5.load
alias.load            autoindex.conf   env.load          reqtimeout.conf
auth_basic.load       autoindex.load   mime.conf         reqtimeout.load
authn_file.load       cgi.load         mime.load         setenvif.conf
authz_default.load    deflate.conf     negotiation.conf  setenvif.load
authz_groupfile.load  deflate.load     negotiation.load  status.conf
authz_host.load       dir.conf         php5.conf         status.load


proxy と proxy_http モジュールを有効にします。

root@debian7-vmw:~# a2enmod proxy
Enabling module proxy.
To activate the new configuration, you need to run:
  service apache2 restart
root@debian7-vmw:~# a2enmod proxy_http
Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
To activate the new configuration, you need to run:
  service apache2 restart


proxy.conf を修正します。

root@debian7-vmw:~# vim /etc/apache2/mods-available/proxy.conf

---
ProxyRequests Off
# Remember to turn the next line off if you are proxying to a NameVirtualHost
ProxyPreserveHost On
<Proxy *>
        Order deny,allow
        #Deny from all
        Allow from all
</Proxy>
# ProxyPass for Geoserver
ProxyPass /geoserver http://localhost:8080/geoserver
ProxyPassReverse /geoserver http://localhost:8080/geoserver

</IfModule>


Apache を再起動します。

root@debian7-vmw:~# /etc/init.d/apache2 restart
[ ok ] Restarting web server: apache2 ... waiting ...

2013年11月6日水曜日

5 - Apache2 の設定

インストールされていないときは、Synaptic パッケージマネージャでインストールしてください。
Web ブラウザ(iceweasel)のアドレスバーに「http://localhost/」と入力してEnter キーを押して右の図のように表示されれば、Apache2 が動作しています。

5-1 mapsite ディレクトリの作成
ここをサイトの公開場所(HTML ファイルの保存場所)にします。
端末(ターミナル)で user ディレクトリに mapsite ディレクトリを作成します。

~$ mkdir mapsite

5-2 Apacheの設定
設定ファイルは次のディレクトリにあります。
(システムターミナル・スーパーユーザーモードで)

#ls /etc/apache2/sites-available
default

有効になっているファイルは次のディレクトリで分かります。

#ls /etc/apache2/sites-enabled
000-default

default ファイルを mapsite という名前でコピーして修正します。
コピーに問題があった場合に default を有効にしなおします。

#cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mapsite

mapsiteファイルに次のように追加します。userの部分は自分の環境に合わせて換えてください。

<VirtualHost *:80>
---
 Alias /mapsite/ "/home/user/mapsite/"
 <directory "/home/user/mapsite">
  Options Indexes MultiViews FollowSymLinks <-1
  AllowOverride None <- 2
  Order deny,allow <- 3
  Deny from all <- 4
  Allow from 127.0.0.0/255.0.0.0 ::1/128 <-5
  Allow from 192.168.1.0/24 <-6
 </directory>
</virtualhost>


1:Options ドキュメントルート内での追加機能
Indexes ファイル一覧表示を許可(index.html がなかったとき他のファイルを表示)
MultiViews 要求に一番近いファイルを検索
FollowSymLinks シンボリックリンクの許可(ファイルを別の名前で呼び出す)
2: .htaccess による設定変更
None 不可
3: Order アクセス制限の順序
deny,allow 拒否してから許可
4: Deny from 拒否の条件
all すべて
5 Allow from 許可の条件
127.0.0.0/255.0.0.0 ::1/128
このコンピュータ
6 Allow from 許可の条件
192.168.1.0/24 私の自宅のネットワーク

default の設定を無効にして、mapsite の設定を有効にします。

#a2dissite default
#a2ensite mapsite

Apache2 を再起動してください。
# /etc/init.d/apache2 restart

5-3 動作確認
mapsite に次のような内容のファイルを作成して、Web ブラウザ(iceweasel)のアドレスバーに「http://localhost/mapsite」と入力してEnter キーを押して右の図のように表示されれば、設定完了です。
nob61@debian7-vmw:~/mapsite$ vim index.html
<html>
 <head>
  <title>mapsite test</title>
 </head>
 <body>
  mapsite
  It works!
 </body>
</html>
:wq

2011年4月14日木曜日

4 Apache2 の設定 - Debian 6

インストールされていないときは、Synaptic パッケージマネージャでインストールしてください。

4-1 mapsite ディレクトリの作成
user ディレクトリに mapsite ディレクトリを作成。

user@deb6-vmw:~$ mkdir mapsite

4-2 (Webサーバ・エイリアスにあるように、)手動でApacheの設定をします。
設定ファイルは次のディレクトリにあります。

#ls /etc/apache2/sites-available
default

有効になっているファイルは次のディレクトリで分かります。

#ls /etc/apache2/sites-enabled
000-default

defaultファイルを mapsite という名前でコピーして修正します。
コピーに問題があった場合にdefaultを有効にしなおします。

#cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mapsite

mapsiteファイルに次のように追加します。userの部分は自分の環境に合わせて換えてください。
<virtualhost>
---
 Alias /mapsite/ "/home/user/mapsite/"
 <directory "/home/user/mapsite">
  Options Indexes MultiViews FollowSymLinks <-1
  AllowOverride None <- 2
  Order deny,allow <- 3
  Deny from all <- 4
  Allow from 127.0.0.0/255.0.0.0 ::1/128 <-5
  Allow from 192.168.1.0/24 <-6
 </directory>
</virtualhost>

1:Options ドキュメントルート内での追加機能
Indexes ファイル一覧表示を許可(index.html がなかったとき他のファイルを表示)
MultiViews 要求に一番近いファイルを検索
FollowSymLinks シンボリックリンクの許可(ファイルを別の名前で呼び出す)
2: .htaccess による設定変更
None 不可
3: Order アクセス制限の順序
deny,allow 拒否してから許可
4: Deny from 拒否の条件
all すべて
5 Allow from 許可の条件
127.0.0.0/255.0.0.0 ::1/128
このコンピュータ
6 Allow from 許可の条件
192.168.1.0/24 私の自宅のネットワーク

defaultの設定を無効にして、mapsite の設定を有効にします。

#a2dissite default
#a2ensite mapsite

Apache2 を再起動してください。
# /etc/init.d/apache2 restart