質問: apache +ホームサーバーが外部トラフィックを許可しない 新しい質問をすることについての判決が何であるかはわかりませんが、私の前の質問が答えられたように感じました この投稿で 。これで、サーバーでwamp/wwwフォルダーの外部にディレクトリを正しくセットアップできるようになり、ネットワーク内でのみurlwww.acyrid.comを介してサイトにアクセスできるようになりました。これらは前の質問の2つの大きなポイントでした。また、その投稿の3番目の主要なポイントであるwamp/wwwディレクトリを介してローカルホストにアクセスすることもできます。私の問題は次のとおりです:なぜ外部トラフィックを受信できないのですか?私は数人の友人に上記のurl( www.acyrid.com )をテストしてもらいましたが、彼らは少し後にタイムアウトしました。プロキシ経由でテストし、タイムアウトしました。以下に、httpdファイルとhttpd-vhosts confファイルを貼り付けて、エラーを見つけるのに役立つかどうかを確認しますが、最初にもう少し情報を提供します。コマンドnetsh advfirewall set allprofiles state offを使用してwinowsファイアウォールを無効にしました 私のosはwindows7 home premium 64ビットです。ルーターのポート80を開き、それをtcp on ip 192.168.1.50( "static" ip i've "選択)私のルーターは私は次のものを持っています: サーバー(windows 7) apache 2.2.17 mysql 5.1.53 php5.3.4。 linksyse2000ルーター windows 7 home premium(64ビット) 私は次のことをしました: コマンドプロンプトでwindowsファイアウォールを無効にする:netsh advfirewall set allprofiles state off 開いたポート80(http)および21(ftp)からtcp on ip:192.168.1.50( "static" ip) 外部ipはfreedns.afraid.org経由で正しく転送されました(実行しているゲームサーバーがacyrid.com:25565経由の外部接続を許可しているため、これを知っています) httpd.conf # # this is the main apache http server configuration file. it contains the # configuration directives that give the server its instructions. # see <url:http://httpd.apache.org/docs/2.2> for detailed information. # in particular, see # <url:http://httpd.apache.org/docs/2.2/mod/directives.html> # for a discussion of each configuration directive. # # do not simply read the instructions in here without understanding # what they do. they're here only as hints or reminders. if you are unsure # consult the online docs. you have been warned. # # configuration and logfile names: if the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for win32), the # server will use that explicit path. if the filenames do *not* begin # with "/", the value of serverroot is prepended -- so "logs/foo.log" # with serverroot set to "c:/program files/apache software foundation/apache2.2" will be interpreted by the # server as "c:/program files/apache software foundation/apache2.2/logs/foo.log". # # note: where filenames are specified, you must use forward slashes # instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). # if a drive letter is omitted, the drive on which apache.exe is located # will be used by default. it is recommended that you always supply # an explicit drive letter in absolute paths to avoid confusion. # # serverroot: the top of the directory tree under which the server's # configuration, error, and log files are kept. # # do not add a slash at the end of the directory path. if you point # serverroot at a non-local disk, be sure to point the lockfile directive # at a local disk. if you wish to share the same serverroot for multiple # httpd daemons, you will need to change at least lockfile and pidfile. # serverroot "c:/wamp/bin/apache/apache2.2.17" # # listen: allows you to bind apache to specific ip addresses and/or # ports, instead of the default. see also the <virtualhost> # directive. # # change this to listen on specific ip addresses as shown below to # prevent apache from glomming onto all bound ip addresses. # #listen 12.34.56.78:80 listen *:80 # # dynamic shared object (dso) support # # to be able to use the functionality of a module which was built as a dso you # have to place corresponding `loadmodule' lines at this location so the # directives contained in it are actually available _before_ they are used. # statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # example: # loadmodule foo_module modules/mod_foo.so # loadmodule actions_module modules/mod_actions.so loadmodule alias_module modules/mod_alias.so loadmodule asis_module modules/mod_asis.so loadmodule auth_basic_module modules/mod_auth_basic.so #loadmodule auth_digest_module modules/mod_auth_digest.so #loadmodule authn_alias_module modules/mod_authn_alias.so #loadmodule authn_anon_module modules/mod_authn_anon.so #loadmodule authn_dbd_module modules/mod_authn_dbd.so #loadmodule authn_dbm_module modules/mod_authn_dbm.so loadmodule authn_default_module modules/mod_authn_default.so loadmodule authn_file_module modules/mod_authn_file.so #loadmodule authnz_ldap_module modules/mod_authnz_ldap.so #loadmodule authz_dbm_module modules/mod_authz_dbm.so loadmodule authz_default_module modules/mod_authz_default.so loadmodule authz_groupfile_module modules/mod_authz_groupfile.so loadmodule authz_host_module modules/mod_authz_host.so #loadmodule authz_owner_module modules/mod_authz_owner.so loadmodule authz_user_module modules/mod_authz_user.so loadmodule autoindex_module modules/mod_autoindex.so #loadmodule cache_module modules/mod_cache.so #loadmodule cern_meta_module modules/mod_cern_meta.so loadmodule cgi_module modules/mod_cgi.so #loadmodule charset_lite_module modules/mod_charset_lite.so #loadmodule dav_module modules/mod_dav.so #loadmodule dav_fs_module modules/mod_dav_fs.so #loadmodule dav_lock_module modules/mod_dav_lock.so #loadmodule dbd_module modules/mod_dbd.so #loadmodule deflate_module modules/mod_deflate.so loadmodule dir_module modules/mod_dir.so #loadmodule disk_cache_module modules/mod_disk_cache.so #loadmodule dumpio_module modules/mod_dumpio.so loadmodule env_module modules/mod_env.so #loadmodule expires_module modules/mod_expires.so #loadmodule ext_filter_module modules/mod_ext_filter.so #loadmodule file_cache_module modules/mod_file_cache.so #loadmodule filter_module modules/mod_filter.so #loadmodule headers_module modules/mod_headers.so #loadmodule ident_module modules/mod_ident.so #loadmodule imagemap_module modules/mod_imagemap.so loadmodule include_module modules/mod_include.so #loadmodule info_module modules/mod_info.so loadmodule isapi_module modules/mod_isapi.so #loadmodule ldap_module modules/mod_ldap.so #loadmodule logio_module modules/mod_logio.so loadmodule log_config_module modules/mod_log_config.so #loadmodule log_forensic_module modules/mod_log_forensic.so #loadmodule mem_cache_module modules/mod_mem_cache.so loadmodule mime_module modules/mod_mime.so #loadmodule mime_magic_module modules/mod_mime_magic.so loadmodule negotiation_module modules/mod_negotiation.so #loadmodule proxy_module modules/mod_proxy.so #loadmodule proxy_ajp_module modules/mod_proxy_ajp.so #loadmodule proxy_balancer_module modules/mod_proxy_balancer.so #loadmodule proxy_connect_module modules/mod_proxy_connect.so #loadmodule proxy_ftp_module modules/mod_proxy_ftp.so #loadmodule proxy_http_module modules/mod_proxy_http.so #loadmodule rewrite_module modules/mod_rewrite.so loadmodule setenvif_module modules/mod_setenvif.so #loadmodule speling_module modules/mod_speling.so #loadmodule ssl_module modules/mod_ssl.so #loadmodule status_module modules/mod_status.so #loadmodule substitute_module modules/mod_substitute.so #loadmodule unique_id_module modules/mod_unique_id.so #loadmodule userdir_module modules/mod_userdir.so #loadmodule usertrack_module modules/mod_usertrack.so #loadmodule version_module modules/mod_version.so loadmodule vhost_alias_module modules/mod_vhost_alias.so loadmodule php5_module "c:/wamp/bin/php/php5.3.4/php5apache2_2.dll" <ifmodule !mpm_netware_module> <ifmodule !mpm_winnt_module> # # if you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # user/group: the name (or #number) of the user/group to run httpd as. # it is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # user daemon group daemon </ifmodule> </ifmodule> # 'main' server configuration # # the directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <virtualhost> definition. these values also provide defaults for # any <virtualhost> containers you may define later in the file. # # all of these directives may appear inside <virtualhost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # serveradmin: your address, where problems with the server should be # e-mailed. this address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # serveradmin admin@localhost # # servername gives the name and port that the server uses to identify itself. # this can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # if your host doesn't have a registered dns name, enter its ip address here. # servername localhost:80 # # documentroot: the directory out of which you will serve your # documents. by default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # documentroot "c:/wamp/www/" # # each directory to which apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # first, we configure the "default" to be a very restrictive set of # features. # <directory /> options followsymlinks allowoverride none order deny,allow deny from all </directory> # # note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # this should be changed to whatever you set documentroot to. # <directory "c:/wamp/www/"> # # possible values for the options directive are "none", "all", # or any combination of: # indexes includes followsymlinks symlinksifownermatch execcgi multiviews # # note that "multiviews" must be named *explicitly* --- "options all" # doesn't give it to you. # # the options directive is both complicated and important. please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # options indexes followsymlinks # # allowoverride controls what directives may be placed in .htaccess files. # it can be "all", "none", or any combination of the keywords: # options fileinfo authconfig limit # allowoverride all # # controls who can get stuff from this server. # # onlineoffline tag - don't remove order deny,allow deny from all allow from 127.0.0.1 </directory> # # directoryindex: sets the file that apache will serve if a directory # is requested. # <ifmodule dir_module> directoryindex index.php index.php3 index.html index.htm </ifmodule> # # the following lines prevent .htaccess and .htpasswd files from being # viewed by web clients. # <filesmatch "^\.ht"> order allow,deny deny from all satisfy all </filesmatch> # # errorlog: the location of the error log file. # if you do not specify an errorlog directive within a <virtualhost> # container, error messages relating to that virtual host will be # logged here. if you *do* define an error logfile for a <virtualhost> # container, that host's errors will be logged there and not here. # errorlog "c:/wamp/logs/apache_error.log" # # loglevel: control the number of messages logged to the error_log. # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # loglevel warn <ifmodule log_config_module> # # the following directives define some format nicknames for use with # a customlog directive (see below). # logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\"" combined logformat "%h %l %u %t \"%r\" %>s %b" common <ifmodule logio_module> # you need to enable mod_logio.c to use %i and %o logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\" %i %o" combinedio </ifmodule> # # the location and format of the access logfile (common logfile format). # if you do not define any access logfiles within a <virtualhost> # container, they will be logged here. contrariwise, if you *do* # define per-<virtualhost> access logfiles, transactions will be # logged therein and *not* in this file. # customlog "c:/wamp/logs/access.log" common # # if you prefer a logfile with access, agent, and referer information # (combined logfile format) you can use the following directive. # #customlog "logs/access.log" combined </ifmodule> <ifmodule alias_module> # # redirect: allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. the client # will make a new request for the document at its new location. # example: # redirect permanent /foo http://localhost/bar # # alias: maps web paths into filesystem paths and is used to # access content that does not live under the documentroot. # example: # alias /webpath /full/filesystem/path # # if you include a trailing / on /webpath then the server will # require it to be present in the url. you will also likely # need to provide a <directory> section to allow access to # the filesystem path. # # scriptalias: this controls which directories contain server scripts. # scriptaliases are essentially the same as aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. the same rules about trailing "/" apply to scriptalias # directives as to alias. # scriptalias /cgi-bin/ "cgi-bin/" </ifmodule> <ifmodule cgid_module> # # scriptsock: on threaded servers, designate the path to the unix # socket used to communicate with the cgi daemon of mod_cgid. # #scriptsock logs/cgisock </ifmodule> # # "c:/program files/apache software foundation/apache2.2/cgi-bin" should be changed to whatever your scriptaliased # cgi directory exists, if you have that configured. # <directory "cgi-bin"> allowoverride none options none order allow,deny allow from all </directory> # # defaulttype: the default mime type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # if your server contains mostly text or html documents, "text/plain" is # a good value. if most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text. # defaulttype text/plain <ifmodule mime_module> # # typesconfig points to the file containing the list of mappings from # filename extension to mime-type. # typesconfig conf/mime.types # # addtype allows you to add to or override the mime configuration # file specified in typesconfig for specific file types. # #addtype application/x-gzip .tgz # # addencoding allows you to have certain browsers uncompress # information on the fly. note: not all browsers support this. # #addencoding x-compress .z #addencoding x-gzip .gz .tgz # # if the addencoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # addtype application/x-compress .z addtype application/x-gzip .gz .tgz addtype application/x-httpd-php .php addtype application/x-httpd-php .php3 # # addhandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. these can be either built into the server # or added with the action directive (see below) # # to use cgi scripts outside of scriptaliased directories: # (you will also need to add "execcgi" to the "options" directive.) # #addhandler cgi-script .cgi # for type maps (negotiated resources): #addhandler type-map var # # filters allow you to process content before it is sent to the client. # # to parse .shtml files for server-side includes (ssi): # (you will also need to add "includes" to the "options" directive.) # #addtype text/html .shtml #addoutputfilter includes .shtml </ifmodule> # # the mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. the mimemagicfile # directive tells the module where the hint definitions are located. # #mimemagicfile conf/magic # # customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # some examples: #errordocument 500 "the server made a boo boo." #errordocument 404 /missing.html #errordocument 404 "/cgi-bin/missing_handler.pl" #errordocument 402 http://localhost/subscription_info.html # # # enablemmap and enablesendfile: on systems that support it, # memory-mapping or the sendfile syscall is used to deliver # files. this usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # #enablemmap off #enablesendfile off # supplemental configuration # # the configuration files in the conf/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # server-pool management (mpm specific) #include conf/extra/httpd-mpm.conf # multi-language error messages #include conf/extra/httpd-multilang-errordoc.conf # fancy directory listings include conf/extra/httpd-autoindex.conf # language settings #include conf/extra/httpd-languages.conf # user home directories #include conf/extra/httpd-userdir.conf # real-time info on requests and configuration #include conf/extra/httpd-info.conf # virtual hosts include conf/extra/httpd-vhosts.conf # local access to the apache http server manual #include conf/extra/httpd-manual.conf # distributed authoring and versioning (webdav) #include conf/extra/httpd-dav.conf # various default settings #include conf/extra/httpd-default.conf # secure (ssl/tls) connections #include conf/extra/httpd-ssl.conf # # note: the following must must be present to support # starting without ssl on platforms with no /dev/random equivalent # but a statically compiled-in mod_ssl. # <ifmodule ssl_module> sslrandomseed startup builtin sslrandomseed connect builtin </ifmodule> include "c:/wamp/alias/*" httpd-vhosts.conf # # virtual hosts # # if you want to maintain multiple domains/hostnames on your # machine you can setup virtualhost containers for them. most configurations # use only name-based virtual hosts so the server doesn't need to worry about # ip addresses. this is indicated by the asterisks in the directives below. # # please see the documentation at # <url:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # you may use the command line option '-s' to verify your virtual host # configuration. # # use name-based virtual hosting. # namevirtualhost *:80 # # virtualhost example: # almost any apache directive may go into a virtualhost container. # the first virtualhost section is used for all requests that do not # match a servername or serveralias in any <virtualhost> block. # <virtualhost *:80> documentroot c:/wamp/www/acyrid servername www.acyrid.com <directory "c:/wamp/www"> options indexes followsymlinks includes execcgi allowoverride all order allow,deny allow from all </directory> <directory "c:/wamp/www/acyrid"> options indexes followsymlinks includes execcgi allowoverride all order allow,deny allow from all </directory> </virtualhost> 回答をお待ちしております。新しい質問を投稿する際のルールや前例に違反した場合は、お詫び申し上げます。私は新しい質問を投稿する前にfaqを読み通しました、そして私は可能な限り徹底的にしようとしています。更新:したがって、提供された修正により、リンクwww.acyrid.comにアクセスしてサイトを表示できますが、自分のネットワークからのみ、他の誰もまだアクセスできません。あの人について何かアイデアはありますか?
回答: 私がすぐに気づいたいくつかのこと: listen localhost:80は、apacheがローカルホストからのリクエストにのみ応答し、サイトがインターネット上で利用できないことを意味します。通常、この行はlisten :80であり、すべてのホストipアドレスをリッスンするか、ホストの特定の外部ipアドレスを入力できます。 必要なnamevirtualhost行は1つだけで、listenエントリと一致する必要があります。いくつかの良い例と説明については、 一般的な設定ミス を参照してください。 同様に、virtualhostエントリをnamevirtualhost行と一致させる必要があります。 www.acyrid.comには2つのエントリがあります。 1つを削除するか、必要に応じてそれらを結合します。 2番目のエントリのdocumentrootが間違っている可能性があります。 それを修正してトラブルシューティングするためのいくつかの具体的な提案: 可能な限り単純な構成から始めて、それが機能することを確認するためにテストしてから、追加を開始し、途中で各ステップをテストします。まず、virtualhostエントリを1つだけ作成し、それが機能するまでローカルホストでテストします。次に、外部でテストして、機能することを確認します。そうして初めて、より複雑な、または追加のvirtualhostエントリに移動します。 サーバーがインターネットから外部からアクセスできることを確認してください。簡単なテストとして、サーバーにping、ftp、telnet、sshを実行してみてください。サーバーにアクセスできない場合、問題はネットワーク/ dns構成の問題です。 apacheの問題を解決する前に、それを解決してください。 サイトに接続しようとしたときに発生するエラーの種類に細心の注意を払ってください。これらは、問題の原因を絞り込むのに役立ちます。たとえば、403 apacheエラーは通常、ファイル/ディレクトリのアクセス許可が正しく構成されていないことが原因です(apacheはファイルを提供しようとしていますが、読み取ることができません)。 403エラーを修正しようとしてvirtualhostsエントリを操作すると、サイトがさらに壊れてしまう可能性があります。