How to make my localhost accessible from outside?

Hi …

what I need to make my local server accessible from outside when i`m on the net ?

when I write my ip/public on my pc is work, but from another pc i got page not found, what setting I need to change ?


Alias /public/ "C:/PHP/www/public/"
<Directory "C:/PHP/www/public/">
	Options Indexes FollowSymLinks MultiViews
	AllowOverride None
	Order allow,deny
	Allow from all
	DirectoryIndex index.htm
</Directory>

this from httpd.conf .

thx

At a guess then, your ISP could be blocking port 80, if entering your public IP into your browser on the PC running the server works but it doesn’t work from an external pc then it’s most likely to be that than anything else.

Hi Karl …

I don`t think so … be coz if I enter just my ip i get ‘Forbidden’ msg … this mean port 80 is open, but I think is settings in httpd.conf !

Can you post the relevant parts of your httpd.conf? Like the virtualhost block? (If you’re using it) and the directive concerning what IPs and ports to listen too.

hmm … this the hard question :slight_smile:
im on network stand from 3 pc , and I didnt edit any thing in httpd.conf, this what u need ?!


#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80
#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

 
# Port: The port to which the standalone server listens.  Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port.  Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80
##
##  SSL Support
##
##  When we also provide SSL we have to listen to the 
##  standard HTTP port (see above) and to the HTTPS port
##
#<IfDefine SSL>
#Listen 80
#Listen 443
#</IfDefine>
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin [email=server_admin@httpd.conf]server_admin@httpd.conf[/email]
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., [http://123.45.67.89/](http://123.45.67.89/))
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your 
# machine always knows itself by this address. If you use Apache strictly for 
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost

#
# 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:/PHP/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 
# permissions.  (dev5 is not as strict as default !!! [Options FollowSymLinks])
#
<Directory "C:/PHP/www/">
	Options FollowSymLinks MultiViews
	AllowOverride None
</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:/PHP/www/">
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#again a little lax for dev5 since this is a development machine correct ? ;)
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"
#
#  AllowOverride AuthConfig FileInfo
AllowOverride All
#
# Controls who can get stuff from this server.
#
	Order allow,deny
	Allow from localhost 127.0.0.1
</Directory>
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used.  See
# the UserDir documentation for details.
#
<IfModule mod_userdir.c>
	UserDir "C:/PHP/apache/users/"
</IfModule>
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "C:/PHP/apache/users">
#	AllowOverride FileInfo AuthConfig Limit
#	Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#	<Limit GET POST OPTIONS PROPFIND>
#		Order allow,deny
#		Allow from all
#	</Limit>
#	<LimitExcept GET POST OPTIONS PROPFIND>
#		Order deny,allow
#		Deny from all
#	</LimitExcept>
#</Directory>
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
	DirectoryIndex index.html index.php
</IfModule>
#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\\.ht">
	Order allow,deny
	Deny from all
	Satisfy All
</Files>
#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs
#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
<IfModule mod_mime.c>
	TypesConfig conf/mime.types
</IfModule>

sorry for this … i`m newbie !

Hi,

Try changing:

#BindAddress *

To

BindAddress *

And restarting Apache and see how you go.

page not found :frowning:

Hi,
according to the documentation the use of the BindAddress directive is deprecated, also as default BindAddress is already set to ``*‘’.

Your main problems, for what I can see…, were two:

  1. DocumentRoot’s path does not need to contain the trailing slash
  2. you allowed accesses only from your pc

Here is your httpd.conf modified, I maked in bold what I edited:


#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80
#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *


# Port: The port to which the standalone server listens.  Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port.  Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80
##
##  SSL Support
##
##  When we also provide SSL we have to listen to the
##  standard HTTP port (see above) and to the HTTPS port
##
#<IfDefine SSL>
#Listen 80
#Listen 443
#</IfDefine>
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin [email=server_admin@httpd.conf]server_admin@httpd.conf[/email]
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., [http://123.45.67.89/](http://123.45.67.89/))
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost

#
# 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.
#
[b]DocumentRoot "C:/PHP/www"[/b]
#
# 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
# permissions.  (dev5 is not as strict as default !!! [Options FollowSymLinks])
#
[b]<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>[/b]
#
# 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.
#
[b]<Directory "C:/PHP/www">[/b]
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#again a little lax for dev5 since this is a development machine correct ? ;)
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
#  AllowOverride AuthConfig FileInfo
AllowOverride All
#
# Controls who can get stuff from this server.
#
	Order allow,deny
	[b]Allow from all[/b]
</Directory>
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used.  See
# the UserDir documentation for details.
#
<IfModule mod_userdir.c>
	UserDir "C:/PHP/apache/users/"
</IfModule>
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "C:/PHP/apache/users">
#	AllowOverride FileInfo AuthConfig Limit
#	Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#	<Limit GET POST OPTIONS PROPFIND>
#		Order allow,deny
#		Allow from all
#	</Limit>
#	<LimitExcept GET POST OPTIONS PROPFIND>
#		Order deny,allow
#		Deny from all
#	</LimitExcept>
#</Directory>
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
	DirectoryIndex index.html index.php
</IfModule>
#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\\.ht">
	Order allow,deny
	Deny from all
	Satisfy All
</Files>
#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs
#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On
#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
<IfModule mod_mime.c>
	TypesConfig conf/mime.types
</IfModule>

that should work :slight_smile:

Thanks,
:slight_smile: Andrea

Shows how much I manually configure Apache these days without using vhost blocks.

Hi Karl …
I got apache error !


Syntax error on line 339 of c:/php/apache/conf/httpd.conf:
Invalid command '<Directory>', perhaps mis-spelled or defined by a module not in
cluded in the server configuration

I found the error :
<Directory />

when I removed the slash work fine :slight_smile: thx alot !

But now the whole folders is accessible … i need to make 1 folder accessible … is that possible ?