に仮想ホストをバインドすることはできません。私は仮想ベースのホストを使っているので、ドメイン 'my.domain'と 'sub1.my.domain'、 'sub2.my.domain'などのようなサブドメインはほとんどありません。それぞれには/ etc/httpd/conf/vhosts /。は、私はCentOSのとApacheとVDSを持っているのhttpd(CentOSの)と異なるポート
私はsub1.my.domainからのすべての接続をリダイレクトする必要があります:8080をanother.web.site:8080に。だから私はsub1.my.domainのルートディレクトリで.htaccessファイルでこの行を追加しました:
RewriteEngine On
RewriteCond %{SERVER_PORT} 8080
RewriteCond %{REQUEST_URI} ^/
RewriteRule (.*) http://another.web.site:8080
しかし、ウェブサーバがポート80のみを聞くので、それは動作しませんでしたので、私に変更の/ etc/httpd/httpd.confを次のように変更します。
Listen 80
Listen 8080
そして、変更されたsub1.my.domainのvhostファイルが修正されました。代わりに...の
<VirtualHost myserverip:80>
ServerName sub1.my.domain
AddDefaultCharset off
AssignUserID www-root www-root
DirectoryIndex index.html
DocumentRoot /var/www/www-root/data/www/sub1.my.domain
...
</VirtualHost>
... official documentationで説明したように、それは今の内容
<VirtualHost myserverip:8080>
ServerName sub1.my.domain
AddDefaultCharset off
AssignUserID www-root www-root
DirectoryIndex index.html
DocumentRoot /var/www/www-root/data/www/sub1.my.domain
...
</VirtualHost>
は、だから私は、ドメインの仮想で解決するのhttpdの設定とセットアップ新しいポートでリッスンする新しいポートを追加しましたホスト構成。しかし、私がsub1.my.domain:8080を開こうとすると、エラーが発生します。ブラウザはそのアドレスを解決できません。私は8080ポートをiptables経由で転送し、サーバ全体を再起動しましたが、何も助けてくれませんでした。私が間違っていた何
?