Big lesson here! We’re getting closer.
Editing your hosts file (and other stuff)
Brad here again, and yesterday I showed you how to get your own free dynamic domain name.
Today, you need to edit your Windows configuration so that you can type your domain name into your web browser instead of “localhost”.
You need to know the IP address of your local computer. We also learned that in a previous lesson.
Hint: Start | Run | cmd (enter) | ipconfig (enter)
Actually, I should say, you need to do this on the computer where you’ve installed XAMPP! ![]()
Then, you need to edit the hosts file. Remember that? We learned about the hosts file in a past lesson about stopping ads
Hint: Start | Run | notepad c:windowssystem32driversetchosts (enter)
The IP address you retrieved with the ipconfig command needs to be entered into your hosts file.
Add a new line that looks like this:
myhostname.my_selected_domain.my_selected_domain.country
For example, the DIY Webserver website is at http://diyws.ath.cx, so the line in my hosts file looks like:
192.168.1.4 diyws.ath.cx
Save the file and exit Notepad.
Now you can start up a web browser, and type http://diyws.ath.cx (using my example of course!) instead of http://localhost
Let me know how you go, please. I want to make sure you can all follow this, and that you get going as soon as possible.
(Here’s a little tip as I write this – my keyboard has failed quite dismally – when I press b or x, I get nothing!
So, fire up Notepad, hold down the ALT key and enter the value (using the numeric keypad) from the DEC column for the character you want (in red) from the table at http://www.asciitable.com – I need b and x so I held ALT and typed 098 – this gave me a b – similarly for x – hold ALT and type 120. Then, copy and paste from Notepad when you need that character – or until you can go out and get a new keyoard (oops, missed the b!) !
)
Serving web pages.
Once you’ve gotten this far, it’s time to tell Apache (the webserver in the XAMPP installation) where our “document root” is. This simply means the folder where you’re going to store, and from which Apache will serve, your webpages.
One word here – regardless of whether you’ve installed XAMPP on your personal computer (the one where your email is, ie: the one you use everyday) or some other machine inside your local network… hmmm – ok – we need to talk about this.
goodness me…
Your Internet connection comes into a modem, or modem/router. This device can be connected to your computer in a couple of different ways.
The first way is via a USB cable which connects the modem (or modem/router) to your one and only computer.
If you have more than one computer, you’ll probably have an RJ45 cable (Cat 5 or Cat 6 cable – usually blue) running from the Ethernet ports on your modem (or modem/router) and plugged into the Ethernet port on your computer.
Your modem (or modem/router) has an external, or WAN (Wide Area Network) IP address, and the machines on the other side of the modem (or modem/router) (ie in your home) has an internal, or LAN (Local Area Network) IP address.
The LAN address is the one you see when you do the ipconfig command on your local computer, regardless of whether you have one or several computers. The WAN address is the one that Dyndns.com saw when you created your own domain name, because that address came from your modem (or modem/router) rather than from your local computer. This is the big distinction, and one you need to understand when we get to port forwarding (you learned about ports in a previous lesson) because you’ll need to forward ports from the WAN to a particular machine on your LAN. We’ll get to that soon.
For the moment, lets assume that someone on the wider Internet (yes, from the WAN) wants to view your website. Apache (your webserver) needs to respond to that request and send back the webpage the user asked for. How does Apache know from where to send that page?
Apache (or at least, the XAMPP configuration) uses two configuration files. The first is httpd.conf, found in c:xamppapacheconf
The other file is called httpd-vhosts.conf, and it can be found inc:xamppapacheconfextra
The main configuration of Apache under XAMPP is controlled by httpd.conf, so lets look at that now. Open this file with Notepad – ie:notepad c:xamppapacheconfhttpd.conf – you know how to do this by now! ![]()
The main lines you need to focus on are (search for these):
Listen 80
If you don’t have any other webserver (or Skype apparently!) you can leave the standard port at 80. If you do have another webserver, or Skype running, you’ll need to change the Listen line from Listen 80 to Listen 8080 (or some other port that isn’t being used.) To check what ports are being used, you can run the portcheck program from your XAMPP installation ie: c:xamppxampp-portcheck.exe. Edit the httpd.conf file to set a port that isn’t being used any other program. So the line should read Listen 8080 (if there is some other program listening on port 80)
Update:
Also put an # in front of the line that says DocumentRoot c:/xampp/htdocs
That’s really all you need from httpd.conf.
The extra config will come from httpd-vhosts.conf. Here’s mine:
# 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 *:8080 # # 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 *:8080> DocumentRoot c:/xampp/htdocs ServerName localhost <Directory /> Options ExecCGI FollowSymLinks Includes Indexes AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml </IfModule> </VirtualHost> <VirtualHost *:8080> DocumentRoot c:/web/diyws ServerName diyws.ath.cx <Directory /> Options ExecCGI FollowSymLinks Includes Indexes AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml </IfModule> ErrorLog "c:/web/diyws/logs/error_log.txt" CustomLog "c:/web/diyws/logs/access_log.txt" common </VirtualHost>
The first defines what to do with requests that come into this server on port 8080 that don’t match any domain name: ie: if someone went directly to my WAN IP address in their browser, and just happened to included the port (8080) Apache is listening on, they would probably be denied (since I’ve set the 1st virtualhost’s ServerName to be localhost) – therefore it won’t match and all they’ll see is an error message from Apache.
The first VirtualHost entry is used by Apache when all else fails, so add this generic one first in your httpd-vhosts.conf file.
The next VirtualHost entry is the one specifically set for the DIY Webserver site. You can see from my DocumentRoot entry that the folder where webpages will be served from is c:webdiyws
The servername is of course, diyws.ath.cx.
The Directory and IfModule sections you can ignore for the moment.
Later on, you’ll be wanting to do some analysis of the traffic you’re getting from your new website, so the ErrorLog and CustomLogdirectives specify where the logs should go. The folder logs should already exist, otherwise Apache will not start correctly.
Tip #45129
Whenever you make a change to either httpd.conf or httpd-vhosts.conf, you will need to stop and start Apache. To do this, click Start, click Programs, click Apache Friends, click XAMPP, click XAMPP Control Panel (if it isn’t already running), then click the Stop button on the Apache entry. Give it a moment, then click the same button (it should now say Start). If Apache doesn’t start, you’ve made an error in your configuration. Go to Control Panel. Admin Tools, Event Viewer and see if there is a message from Apache that tells you why it couldn’t start up. Hint: you may have made an error in the DocumentRoot specification – I know I did! ![]()
So go ahead and create a folder somewhere on your computer – this will be your DocumentRoot. Reference that location in your httpd-vhosts.file, as I’ve shown you above. Set your ServerName to the same name as you entered in your local hosts file. Set the location of the log files if you want to. Now, you should be good to go – but see tip #45129 above!
Restart Apache using tip #45129. If Apache starts up correctly, its time to see if it can serve your first web page.
If everything was successful, congratulations! If not, send me a message with the content of both your httpd.conf file and your httpd-vhosts.conf files and I’ll see what I can do.
To test out our new domain name, you need to create your first HTML page, and to do that, I’ve found a great little editor called NVU. You can download it from http://www.nvudev.com, but that site has been down a few days, so try http://www.download.com/Nvu/3000-2048_4-10412423.html
Install it with the standard options, and fire it up.
Click File | New. Ensure the “A blank document” radio button is the only one selected. Click the Create button.
You’ll see a new window with 4 tabs at the bottom – Normal, HTML Tags, Source and Preview. NVU will default to the Normal tab. For now, just start typing some text.
Now, here’s the biggie. We need to save the content of our new webpage (currently in NVU) to our Apache DocumentRoot folder.
If you are running XAMPP and NVU on the same machine, you can simply save this new HTML document into the folder specified by your DocumentRoot directive. If so, just click File | Save and give it a name like index.html. This is one of the names specified in your httpd-vhosts.conf file for the IfDocument directive – this simply means that someone can type in http://diyws.ath.cx and if one of the document names specified exists, Apache will serve it, otherwise, the web surfer will need to specify exactly which document they want to see. eg: http://diyws.ath.cx/my_first_web_page.html
If you are running XAMPP on a different computer to the one where you’re running NVU, you’ll need to set up the FileZillaFTP service on your XAMPP installation. FTP stands for File Transfer Protocol, and you’ll need to set it up so that you can “publish” documents from your local machine to the machine where Apache is running, then you need to tell NVU how to publish your new HTML document to the DocumentRoot folder you specified in your httpd-vhosts.conf file.
But this is a lesson for another day, and one which you’ll need come the day when you’re away from your actual computer (say, at work) and you need to make changes to your website when you can’t physically be there. Its all possible, but we need to walk before we can run.
Please let me know how you’re getting on, because there is so much extra good stuff available for you – if you can’t get the initial stuff correct, you’re just going to get frustrated, so please, let me know how you’re going. I really want to know.
And later on, we can all help each other by linking to one anothers new websites and get Google to give us some love so web surfers will be able to find our sites. That’s a whole other topic, but stay with me, because I’m going to teach you all this stuff – for free.
This is going to be a whole lot of fun so enjoy the ride, and come visit us on the Facebook group.
Until soon (or before Lesson 7) – send me your feedback by leaving a comment.




Pls Help me !!!!!
upto the last Lesson everything was going fine for me….
But after i followed these steps in lesson 7
i am experiencing problems……..
My website i can View from my computer use localhost but cant view from The WAN…
I am using a Beetel 110TC1 DSL modem..
I also tried to change the NAT Virtual Server settings
i set
application – HTTP_Server
Protocol – All
Start port – 80
End port – 80
local ip address – 192.168.1.20 ( Its the static IP of my website hosting computer on LAN
i set it manually
Still it do not work…
this is my httpd file
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# 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:/xampp/apache” will be interpreted by the
# server as “C:/xampp/apache/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 httpd.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:/xampp/apache”
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 0.0.0.0:80
#Listen [::]: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 # replaced with autoindex_color_module
#LoadModule bucketeer_module modules/mod_bucketeer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule case_filter_module modules/mod_case_filter.so
#LoadModule case_filter_in_module modules/mod_case_filter_in.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 echo_module modules/mod_echo.so
LoadModule env_module modules/mod_env.so
#LoadModule example_module modules/mod_example.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
#
# 3rd party modules
#
LoadModule autoindex_color_module modules/mod_autoindex_color.so
#
# 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
# ‘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
# definition. These values also provide defaults for
# any containers you may define later in the file.
#
# All of these directives may appear inside 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 postmaster@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:/xampp/htdocs”
#
# 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.
#
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
#
# 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.
#
#
# 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 Includes ExecCGI
#
# 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.
#
Order allow,deny
Allow from all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm
default.php default.pl default.cgi default.asp default.shtml default.html default.htm
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
Order allow,deny
Deny from all
Satisfy All
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host’s errors will be logged there and not here.
#
ErrorLog “logs/error.log”
#ScriptLog “logs/cgi.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
#
# 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
# 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
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a
# container, they will be logged here. Contrariwise, if you *do*
# define per- access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog “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
#
# 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 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/ “C:/xampp/cgi-bin/”
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock “logs/cgi.sock”
#
# “C:/xampp/cgi-bin” should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
AllowOverride None
Options None
Order allow,deny
Allow from all
#
# 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
#
# 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
#
# 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 .pl .asp
# 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
#
# 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.
# XAMPP specific settings
Include “conf/extra/httpd-xampp.conf”
# Perl settings
Include “conf/extra/perl.conf”
# 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”
# Distributed authoring and versioning (WebDAV)
Include “conf/extra/httpd-dav.conf”
# Implements a proxy/gateway for Apache.
Include “conf/extra/httpd-proxy.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.
#
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache “shmcb:logs/ssl.scache(512000)”
SSLSessionCacheTimeout 300
this is my httpd-vhost file
#
# 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
#
# 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
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 block.
#
##
##ServerAdmin postmaster@dummy-host.localhost
##DocumentRoot “C:/xampp/htdocs/dummy-host.localhost”
##ServerName dummy-host.localhost
##ServerAlias www.dummy-host.localhost
##ErrorLog “logs/dummy-host.localhost-error.log”
##CustomLog “logs/dummy-host.localhost-access.log” combined
##
##
##ServerAdmin postmaster@dummy-host2.localhost
##DocumentRoot “C:/xampp/htdocs/dummy-host2.localhost”
##ServerName dummy-host2.localhost
##ServerAlias www.dummy-host2.localhost
##ErrorLog “logs/dummy-host2.localhost-error.log”
##CustomLog “logs/dummy-host2.localhost-access.log” combined
##
DocumentRoot c:/xampp/htdocs
ServerName localhost
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
DocumentRoot c:/web/ankari
ServerName ankari.dontexist.com
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
ErrorLog “c:/web/ankari/logs/error_log.txt”
CustomLog “c:/web/ankari/logs/access_log.txt” common
PLease Assist me !!! reply on my Email…..
Thanks in advance………..
Hi Ankush
Thanks for your comment.
Maybe this will help?
http://sanjaygoel.blogspot.com/2007/06/port-forwarding-in-airtel-modem.html
So you’re using dyndns.com for your dynamic host name, but did you download and install and configure their update client?
See: https://www.dyndns.com/support/ (after you’ve logtged in) – the download link is in the top right hand corner.
Do that and let us know how you go.
Cheers
Brad
velmi zaujimave, vdaka
“very interesting, thanks”
HI
I think I’ve done the config OK – anyway apache is running after the changes and restarting it.
typo where you say
ie:notepad c:amppapacheconfhttpd.conf – should be xampp
other instructions seem OK. Contents of the …-vhosts.conf file are quite different to your example, but I just copied and posted yours, and changed the relevant IP, folder names – seems OK.
I tried putting a photo into the web page and saving that to a new name before I saved adn index page – when I tried to look at it in a browser the basic link to my dn goes to this page, but doesn; t show a picture – just the alternative text.
I guess lesson 7 will clear that up
Ian
actually, I looked at my error logs and there is an access request for the image but it is for the original location without the root directory like
“GET /Documents%20and%20Settings/hollidie/My%20Documents/My%…
then the error log says File does not exist: C:/web/ianholliday/Documents and Settings
So I guess I need to put the image in the right place in the first instance.
Hi Ian
The trouble with putting your htdocs folder inside Documents and Settings etc is that you probably need to put inverted commas around the whole path.
“Documents and Settings” is really “documen~1″ if you do a raw directory listing in DOS: dir /b
so I’d move everything out of where you have it and put it in some place like:
c:webstuffian
and then you’ll be ok – I think.
Cheers
Brad
Can you email me back, please. Thanks so much.
Just sent you an email!
Hi
OH! well thats it for me. I got to the part wher I updated the hosts file. whicch I had to copy to the desktop and then put it back again. Using my Dynamic address which was registered. Nothing shows in the browser. I had a feeling I wouldnt get to the end with success. But never mind
Cheers
Mike
Hi Mike
I assume from your comments that you’re running Vista? (ie “copy to desktop and then put back” ?) – yes, I’ve seen that too. No easy way around that unfortunately unless you turn off UAC.
But I think your biggest problem is the dynamic address portion of your post….
If you’re running your new web server on the same machine as you do your day to day stuff, then you’ll need to edit your hosts file to something like this:
192.168.0.55 donthaveoneyet.com
save the file, shutdown/restart your browser, and then ask for that domain, this will still work believe it or not – if you type in “donthaveoneyet.com”, your browser will check the hosts file before it goes off to Internet land… since donthaveoneyet.com (in your hosts file) “resolves” to 192.168.0.55, whatever browser you’re using will then send a request to that IP address – which just happens to be your local Apache server, and it will respond with whatever document you’ve defined as the “default” document in your Apache configuration.
Hmmm – perhaps I’m not explaining this well enough – is there any other info I can provide you with?
Thanks for visiting – I really appreciate your visit – I’d love to come check out your site when you’ve got it all up and running.
Cheers
Brad
Enlgihetnnig the world, one helpful article at a time.
Thanks!
Hi
This is my httpd-vhosts.conf file. It looks nothing like yours.
#
# 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
#
# 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 block.
#
##
##ServerAdmin postmaster@dummy-host.localhost
##DocumentRoot “C:/xampp/htdocs/dummy-host.localhost”
##ServerName dummy-host.localhost
##ServerAlias www.dummy-host.localhost
##ErrorLog “logs/dummy-host.localhost-error.log”
##CustomLog “logs/dummy-host.localhost-access.log” combined
##
##
##ServerAdmin postmaster@dummy-host2.localhost
##DocumentRoot “C:/xampp/htdocs/dummy-host2.localhost”
##ServerName dummy-host2.localhost
##ServerAlias www.dummy-host2.localhost
##ErrorLog “logs/dummy-host2.localhost-error.log”
##CustomLog “logs/dummy-host2.localhost-access.log” combined
##
Can you advise on this please
Cheers
Mike
Hi Mike
First off, I’d make the folders you’ve defined as simple as possible – Apache was borne out of a *nix OS, so we need to take that into consideration.
Where you have:
C:/xampp/htdocs/dummy-host2.localhost
as the folder for the root of your webhost, I’d really recommend a simpler construct:
c:/webstuff/mike/host2
That’s the folder. Your logs would then be:
ErrorLog “c:/webstuff/mike/host2/logs/error_log.txt”
CustomLog “c:/webstuff/mike/host2/logs/access_log.txt” common
etc
Keep your paths as plain as can be – only you see them (well, Apache too) but the people visiting will never know where you keep your root folder…
And also remember to restart Apache after every change.
I hope this helps……
Cheers
Brad
Hi!
Frankly I’m trying to follow these instructions, but I’m stuck at the first step (ipconfig). First, ipconfig (at least on Windows XP) gives up a lot of different lines and you do not explain which one to take as MY IP address. Second, if I take the most obvious one (the first one) and I paste it in a browser, I get NO web site at all (although my Apache/PHP server is well responding on localhost or 127.0.0.1). Third, that IP address correspond on the web to a server in Italy and I’m in North America (and so is my ISP), so I doubt Ipconfig gives me what’s needed. Fourth, I have a WI-FI connection to my router and http://www.abyssunderground.co.uk/ip.php says: ‘It was detected that you are NOT behind an ISP transparent proxy.’ and if I take the IP it gives me (which is different than ipconfig gives), there is NO web site either. Is there a more sophisticated way to do this?… A.R.
Hi Alain
Sorry to hear that you’re having such problems.
Open a command window (Start | Run | “cmd”) and then type:
ipconfig | more
and press Enter. (This pipes the output of ipconfig through the more filter, so you can see all of the ipconfig output – press Enter to see each line, or spacebar to see all of the output)
You need to find the entry that is headed:
“Ethernet adapter Local Area Connection”
It will display something like:
Ethernet adapter Local Area Connection:
Connection-specific DNS suffix:
Link-local IPv6 Address . . . . . : (some hex numbers…)
IPv4 Address. . . . . . . . . . . . .: 192.168.1.x
Subnet Mask . . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . . : 192.168.1.1
The whole idea of updating your hosts file is that you can type the friendly name (ie: diyws.ath.cx) into your browser instead of the IP address – so the number you need is your local machine’s IP address – in the above example, it’d be 192.168.1.x (replace x with whatever value appears) – and here’s the thing – as long as Apache is running on the same machine!
For example, the diyws.ath.cx server is on a machine separate to my laptop – so I have two machines on my network, each with a different IP address (obviously). I need to edit my laptop’s hosts file to tell my browser that the website for diyws.ath.cx is actually located on another IP address.
Actually, after re-reading your post – if you have a connection to your WiFi router, you’ll need to find the:
“Wireless LAN adapter Wireless Network Connection” entry – this will be the one where the wireless router has given your PC/Laptop its IP address (via DHCP) and that will be the one that you’ll need to add into your hosts file.
And really, that’s all we want to do with this step – to update your hosts file so that you can reference your new website using its name, rather than its IP address.
I re-read my own post, and I said:
“Actually, I should say, you need to do this on the computer where you’ve installed XAMPP!”
So, given my two computer setup here, I needed to run the ipconfig command on the computer where I installed XAMPP, which is the “server” PC as it were – not my laptop which I use on a day to day basis. By doing that, I know the IP address of the server, and I put that address into the hosts file on my laptop, so I can use diyws.ath.cx instead of 192.168.1.4 (or whatever IP address the server has)
Does this make sense?
I’ll try and draw a diagram and get it uploaded for you.
For now, thanks for your comment – and I do hope you get it working!
Cheers
Brad
Greetings I am wanting to know if I may use this post on one of my blogs if I link back to you? Thanks
Sure!
in this lesson when im add my dyndns to my hosts file and i go to my link its open my router page and no my page. what is the problem???
thank you..
Could you post the contents of your hosts file?
It should look something like this:
192.168.1.100 myhost.dyndns.com
NOT
122.45.100.66 myhost.dyndns.com
The 192.168.1.100 is the IP address used by your webserver (or a machine on your local network).
The 122.45.100.66 address is the external IP address given to you by your ISP.
You need the LAN address (192.168.1.100) not the WAN address (122.45.100.66) listed in your hosts file.
Let me know how you go.
ok im find i try to my other pc who connect with cable to internet and work
i will go to lesson 7 now 
my other computer when i try this is connecting with wireless and i had this problem… thnk you for all
problem again
i add extra conf and when im try to connect from my browser its open that i have to my htdocs folder and not my D:/web/website i try connect to my site and from my friends house to see my site and its not open
my vhosts file is:
#
# 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
#
# 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 block.
#
#DocumentRoot D:/xampp/htdocs
ServerName localhost
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
#DocumentRoot D:/web/wow
ServerName wowgalaxy.servegame.org
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
ErrorLog “D:/web/wow/logs/error_log.txt”
CustomLog “D:/web/wow/logs/access_log.txt” common
where is the problem ??
thnk you
Bill
Remove the # from your DocumentRoot line.
Try that and let me know.
it seems to be linking to my router… i did something stupid for sure
Hey I have a question, I noticed that my site doesn’t work with www. in front, and neither does yours. What does this mean???????????
The www bit will only work if you upgrade your Dyndns account – I think its $15USD a year.
Then you could do something like www.diyws.ath.cx .
For the moment though, don’t worry too much about that – its not really necessary.
A URL is a URL is a URL – and with all the url shortener services around, it makes it even more not so much necessary.
You’ll need to upgrade your Dyndns account to add wildcards.
From the Dyndns website:
Wildcard?: If Wildcard is disabled, only the third-level hostname will resolve, e.g. myhost.dyndns.org works but www.myhost.dyndns.org doesn’t. If Wildcard is enabled, any fourth-level hostname will resolve, e.g. www.myhost.dyndns.org, asdf1234.myhost.dyndns.org, and so on. This feature is particularly useful for virtual hosting.
Its not really necessary to have www in the front – with all the url shorteners available, it becomes even more not necessary!
IMHO
See below!
Hey I just wanted to say thank you so much! This really saved me! And it was a great, fascinating and fun tutorial! Basically this is my first website, complete website, I’ve ever made (although it’s my friend’s design, it resembles flash a little bit, it was for a her friend) and I wanted to use a content management system. His current host doesn’t support using databases and I need to show him a beta version.
This is as far as I need to go for now, I skimmed through the tutorial in a hurry, so maybe you mentioned this but I missed it, and in case others are having the same problem: You should clarify to forward ports (and how) because I remembered to do it last minute and that’s how I finally got it to work.
Also clarify any security issues? Is there a possibility someone can rummage around through my computer?
And why is it that it doesn’t work if I have www. in front of it?
http://esther.kicks-ass.net/
Thanks again! I will definitely be back soon to try out the rest of your tutorials!
Thanks for the kind words.
Yes, the port forwarding was the very last thing to mention, but I never got around to it.
I’m glad to see you here.
Your self-hosted site looks great by the way, and loads pretty fast too!
Hey Livi
Check out the new Lesson 11 – Port Forwarding
Also have a look at Lesson 4 – Securing XAMPP
Hope that helps!
Cheers
Brad
Thanks for the kind words.
You’ll need to upgrade your Dyndns account to get wildcard support (which’ll let you put anything in front of your domain name, even www!)
From the Dyndns website:
Wildcard?: If Wildcard is disabled, only the third-level hostname will resolve, e.g. myhost.dyndns.org works but www.myhost.dyndns.org doesn’t. If Wildcard is enabled, any fourth-level hostname will resolve, e.g. www.myhost.dyndns.org, asdf1234.myhost.dyndns.org, and so on. This feature is particularly useful for virtual hosting.
can you ansewr me on this http://diyws.ath.cx/lessons/lesson-6-hosts-and-htdocs/comment-page-1/#comment-2461
no its not work and without # on rootdirect open me my httdocs folder
but when i remove the
#DocumentRoot D:/xampp/htdocs
ServerName localhost
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
my site is running to my computer but to others not loading pages…
Hi Bill
Sorry you’re having so much trouble.
One other commenter suggested that I had forgotten the port forwarding lesson – absolutely true.
The reason is that there are so many modem/routers out there, its impossible for me to know how to set all of them up.
Go to http://portforward.com/ and click on the Router List at the top left hand corner. Then, select your router make/model and follow the instructions from there.
This is the final and most important step to getting your site visible to the rest of the world.
I’m really sorry you’ve gone through all this trouble. I had so few people come to this site, and those that did figured it out all by themselves – so I apologise that you’ve been frustrated at not being able to see your site fronm your friends place.
Anyway, read the relevant pages from portforward.com, and I’m sure you’ll get somewhere.
Additionally, I see your chosen domain name, so you need to add a new block to your vhosts file.
DocumentRoot d:/web/wow
ServerName wowgalaxy.servegame.org
Options ExecCGI FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
ErrorLog “d:/web/wow/logs/error_log.txt”
CustomLog “d:/web/wow/logs/access_log.txt” common
Copy the above lines, paste them into your http-vhosts.conf file, change what you need to on the logs directives (replace my example with the location on your computer), save the file, then restart Apache and see what happens.
After you follow the portforward instructions of course.
Let me know how you go.
Cheers
Brad
Hi!
I’ve done all the steps (1 -6) but I have the following problem:
from my computer I can see my page (bobb.dyndns.ws) but I can’t see it from the web – the returned error is (110) Connection timed out.
I can ping my IP but nothing else (from computer not in my network)
I omit something but I don’t know what
My ISP connection is over PPPoE (if this does matter).
Regards,
B.
p.s. sorry for my english
Hi B
Yes, my fault.
In another comment, (see above) you’ll read that you need to perform what’s called “port forwarding” from your modem/router to your web server.
So go to http://www.portforward.com and find your modem/router model. Follow the instructions there, and you should be good to go.
Please let me know how you go.
By the way, what do you intend to use your self-hosted site for? I’d love to know what passions people have – perhaps there’s a script that will do what you want. Let me know and I’ll try and find something for you.
Cheers
Brad
Hi Brad,
thank you for your answer.
I work as a freelancer (flash/flex designer and developer) and I want my clients to have access to their temporarily work.
And this is the main reason.
As I mentioned above my connection is over PPPoE. My ISP’s modem/router is somewhere away and I don’t know (can’t view) the model of the modem. Maybe it have a way but I don’t know it
That’s why I can not use the site portforward.com.
Maybe I shall connect to the my ISP’s support?
Regards,
B.
Hi Bobb
My connection (at home using a Netcomm NB5Plus4 modem/router) is also using PPPoE. VPI=8, VCI=35.
From www.watchguard.com/glossary/p.asp
PPPoE
“A method of transmitting PPP traffic over Ethernet to the Internet through a common broadband medium. Commonly used in Europe. The users have the appearance of “dialing” the Internet, but their computers are in fact always connected.”
So you and I have the same “connection”, but, I can’t understand that you don’t have access to the modem/router? Are you trying to run this from your home connection?
I’m getting really confused now.
The only other thing I can think of is that you’re trying to get this happening from your work computer? You’re a freelancer, so do you work onsite at a clients site?
If so, I can definitely see your problem – I have no idea of the setup at my work either…. so I can understand the problems you’re having.
Please let me know a bit more about how/where you’re connected, and we can go from there.
I really want to help you get this sorted.
Cheers
Brad
Hi Brad,
I was away from my computer for a lot of time.
Now I write my reply for your information – I was able to solve my quest
Simply I allow the port 80 from firewall. Since I opened the port everything is fine now.
I hope I did correctly
Regards
Bobb
i have portforwand the 80port but try, to go to my site its only loading and loading (in firefox says Threshold time of connection…)
thank you for fast answer
bill…!
Hey Bill
I’m just wondering – did you reconnect to the Internet, and if so, did you refresh your Dyndns updater tool to pick up your IP address?
When I ping wowgalaxy.servegame.org, I get a reply, which means that your domain name (wowgalaxy.servegame.org) is resolving to the IP address 85.74.209.198 – check that IP address against your Dyndns updater and let me know what you find.
Alternatively, Dyndns is running ok, but is Apache listening properly? Try restarting Apache using the XAMPP control panel applet, and see what happens.
Please let me know how you go!
Cheers
Brad
yes my ip is this 85.74.209.198 i have download and intall the dyndns app but only local working the site … thnk you
bill!
Hi Bill
You might need to add an exception to your Windows Firewall.
Go to Control Panel, Windows Firewall.
Depending on your version (mine’s Vista) you need to bring up the Settings dialog box. Click the Exceptions tab.
Click the Add port… button.
In the name box, type Apache Web Server (this is for your reference only)
In the Port number box, type in the port that Apache is listening on (80 by default)
Ensure the TCP radio button is selected.
Click OK.
See how that goes and let me know.
You’re getting closer!
Cheers
Brad
ok i will try (mine is xp) i will find it…
again its not work i have close the firewall and again not loading page…
bill!
Hey Bill
Sorry to hear you’re having so much trouble.
I can’t work out what’s going wrong for you.
Here’s a checklist (as I think of it)
1. Create a domain name at Dyndns. DONE
2. Download, install and configure their updater app. DONE
3. Configure your Apache config vhosts file. DONE
4. Forward port 80 from your modem/router on the WAN to the IP address of the webserver PC on your LAN. DONE
5. Create an exception for Apache on, or disable, Windows Firewall. DONE.
6. Restart everything!
If you’ve done all these things correctly, I can’t think of anything else that will stop people visiting your new publicly accessible website – given that your dynamic domain resolves correctly (to your current IP)
I really will work on creating a video that shows all these steps, and hopefully, will trigger something for you. I just have so little time now-a-days, so please be patient.
Lastly, you might want to view this article from Dyndns:
https://www.dyndns.com/support/kb/why_cant_i_connect_to_my_server.html
Or perhaps this one:
http://www.dyndnscommunity.com/questions/16/how-do-i-access-my-device-from-outside-my-home-network
I hope that helps.
Lastly, can you let me know the make/model of your modem/router?
Thanks for being a member of this website – I really appreciate your comments.
Cheers
Brad
At last, someone comes up with the “right” asnwer!
Hi
I have been trying to set my Desktop Computer as my Web Server (using Xampp) but my site can not be accessed from outside my LAN. Have I missed a step ?
Configurations:
Desktop ipv4 Address: 192.168.0.100
Default Gateway: 192.168.0.1
I am using a D-Link DI-524UP wireless router, the Desktop is connected directly to the D-Link device. I am sure that I have setup Port Forwarding on the router correctly (following PortForward.com)
On my router I set Virtual Server to (Port Forward):
Name – HTTP Server
Private IP – 192.168.0.100
Protocol – TCP 80/80
Schedule – Always
Do I need to forward port 443 ?
I have changed my host file stored in System32 to contain
192.168.0.100 aacoleiro.dyndns.org
*This is my httpd file*
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# 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:/xampp/apache will be interpreted by the
# server as C:/xampp/apache/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 httpd.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:/xampp/apache
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 0.0.0.0:80
#Listen [::]: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 # replaced with autoindex_color_module
#LoadModule bucketeer_module modules/mod_bucketeer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule case_filter_module modules/mod_case_filter.so
#LoadModule case_filter_in_module modules/mod_case_filter_in.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 echo_module modules/mod_echo.so
LoadModule env_module modules/mod_env.so
#LoadModule example_module modules/mod_example.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
#
# 3rd party modules
#
LoadModule autoindex_color_module modules/mod_autoindex_color.so
#
# 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
# ‘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
# definition. These values also provide defaults for
# any containers you may define later in the file.
#
# All of these directives may appear inside 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 postmaster@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:/xampp/htdocs
#
# 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.
#
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
#
# 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.
#
#
# 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 Includes ExecCGI
#
# 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.
#
Order allow,deny
Allow from all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm n default.php default.pl default.cgi default.asp default.shtml default.html default.htm n home.php home.pl home.cgi home.asp home.shtml home.html home.htm
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
Order allow,deny
Deny from all
Satisfy All
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host’s errors will be logged there and not here.
#
ErrorLog logs/error.log
#ScriptLog logs/cgi.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
#
# 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
# 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
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a
# container, they will be logged here. Contrariwise, if you *do*
# define per- access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog 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
#
# 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 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/ C:/xampp/cgi-bin/
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock logs/cgi.sock
#
# C:/xampp/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
AllowOverride None
Options None
Order allow,deny
Allow from all
#
# 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
#
# 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
#
# 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 .pl .asp
# 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
#
# 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.
# XAMPP specific settings
Include conf/extra/httpd-xampp.conf
# Perl settings
Include conf/extra/perl.conf
# 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
# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf
# Implements a proxy/gateway for Apache.
Include conf/extra/httpd-proxy.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.
#
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache shmcb:logs/ssl.scache(512000)
SSLSessionCacheTimeout 300
*This is my httpd-vhosts file*
#
# 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
#
# 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 block.
#
##
##ServerAdmin postmaster@dummy-host.localhost
##DocumentRoot C:/xampp/htdocs/dummy-host.localhost
##ServerName dummy-host.localhost
##ServerAlias www.dummy-host.localhost
##ErrorLog logs/dummy-host.localhost-error.log
##CustomLog logs/dummy-host.localhost-access.log combined
##
##
##DocumentRoot C:/xampp/htdocs
##ServerName aacoleiro.dyndns.org
##ErrorLog logs/dummy-host2.localhost-error.log
##CustomLog logs/dummy-host2.localhost-access.log combined
##
Hope you can find where I have done my error
Adrian
Hey I am back again and this time I am trying to set up a wordpress blog. I haven’t had a chance to go through all the tutorials this second time around, I figured I knew what to do and that I’d just have to reroute it in the httpd-vhosts.conf file to find a different folder in my htdocs folder in xampp. STRANGELY the only thing it’s finding is the index file, the CSS files didn’t link up and if you click on anything else the links say it’s going to localhost. I’m going to try again tomorrow, but in the meantime, what do you think I should do? I had wordpress installed first, so maybe I should reinstall it…
Alright I reinstalled it and it seems to work, that was weird!
I’ve done as you have said, and well I’ve had a bit of trouble. I was able to access my site through my free dyndns domain but as soon as I made changes to allow other people to access it, it all went wrong.
localhost, Firefox can’t establish a connection to the server at localhost.
dyndns, is the same as above but with dyndns.
Apache is successfully running. I cannot click Admin, because that opens up with localhost, so it’s unaccessible.
Here is httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# 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:/xampp/apache” will be interpreted by the
# server as “C:/xampp/apache/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 httpd.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:/xampp/apache”
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 8080
#
# 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 # replaced with autoindex_color_module
#LoadModule bucketeer_module modules/mod_bucketeer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule case_filter_module modules/mod_case_filter.so
#LoadModule case_filter_in_module modules/mod_case_filter_in.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 echo_module modules/mod_echo.so
LoadModule env_module modules/mod_env.so
#LoadModule example_module modules/mod_example.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
#
# 3rd party modules
#
LoadModule autoindex_color_module modules/mod_autoindex_color.so
#
# 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
# ‘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
# definition. These values also provide defaults for
# any containers you may define later in the file.
#
# All of these directives may appear inside 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 postmaster@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:/web/horble”
#
# 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.
#
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
#
# 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.
#
#
# 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 Includes ExecCGI
#
# 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.
#
Order allow,deny
Allow from all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm
default.php default.pl default.cgi default.asp default.shtml default.html default.htm
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
Order allow,deny
Deny from all
Satisfy All
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host’s errors will be logged there and not here.
#
ErrorLog “logs/error.log”
#ScriptLog “logs/cgi.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
#
# 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
# 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
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a
# container, they will be logged here. Contrariwise, if you *do*
# define per- access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog “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
#
# 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 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/ “C:/xampp/cgi-bin/”
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock “logs/cgi.sock”
#
# “C:/xampp/cgi-bin” should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
AllowOverride None
Options None
Order allow,deny
Allow from all
#
# 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
#
# 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
#
# 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 .pl .asp
# 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
#
# 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.
# XAMPP specific settings
Include “conf/extra/httpd-xampp.conf”
# Perl settings
Include “conf/extra/perl.conf”
# 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”
# Distributed authoring and versioning (WebDAV)
Include “conf/extra/httpd-dav.conf”
# Implements a proxy/gateway for Apache.
Include “conf/extra/httpd-proxy.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.
#
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache “shmcb:logs/ssl.scache(512000)”
SSLSessionCacheTimeout 300
AND here is 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
#
# 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 *:8080
#
# 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 block.
#
DocumentRoot c:/web/horble
ServerName horble.dyndns.org
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
DocumentRoot c:/web/horble
ServerName horble.dyndns.org
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
ErrorLog “c:/web/horble/logs/error_log.txt”
CustomLog “c:/web/horble/logs/access_log.txt” common
I’ve port forwarded 80. I configured xampp, so I can access my site with the dyndns.org address, but nobody else can see it. =[
Hello! Would you mind if I share your blog with my zynga group? There’s a lot of folks that I think would really appreciate your content. Please let me know. Cheers
Hey very cool web site!! Man .. Beautiful .. Amazing .. I will bookmark your website and take the feeds also?I am satisfied to seek out so many useful information right here within the submit, we want work out extra strategies on this regard, thank you for sharing. . . . . .
Hey General Web Directory!
Thanks!
Hope it all works out for you.
you are truly a just right webmaster. The web site loading speed is incredible. It sort of feels that you are doing any unique trick. Moreover, The contents are masterpiece. you have done a great task on this subject!
Thanks!
Re website loading speed – I use W3-Cache on this WordPress site. Obviously, its working!
If anyone wants a lesson on how to download, install and configure W3-Cache for best performance, let me know!
I take pleasure in, result in I discovered just what I was having a look for. You’ve ended my 4 day long hunt! God Bless you man. Have a great day. Bye
I’m glad I could help.
Wonderful items from you, man. I’ve take into accout your stuff prior to and you’re simply extremely magnificent. I actually like what you’ve got here, really like what you’re saying and the best way by which you are saying it. You make it enjoyable and you continue to take care of to keep it smart. I cant wait to learn much more from you. This is really a great website.
Thanks dude
Glad to hear that you liked it.
Come back soon!
Very great post. I simply stumbled upon your blog and wished to say that I’ve truly loved browsing your blog posts. After all I will be subscribing to your rss feed and I hope you write once more soon!
Hi!
Cool, and thanks for visiting!
Great weblog here! Also your site quite a bit up fast! What web host are you the usage of? Can I am getting your affiliate link to your host? I desire my site loaded up as fast as yours lol
Hi xbox redeem card
Thanks for commenting.
My web host is my own server, on my own internet connection.
I use W3-Cache on this WordPress site in order to serve pages as fast as possible. It must be working, given your comment!
Re affilate link to my host – well, if I had an affiliate program, you could just link to this site.
Hello there, simply turned into aware of your blog thru Google, and found that it is really informative. I’m gonna watch out for brussels. I will appreciate if you continue this in future. A lot of other folks will be benefited from your writing. Cheers!
Hi reconquistar
Thanks!
Sadly though, I won’t be able to make it to Brussels this year.
Great article but it didn’t have everything! I didn’t find the kitchen sink!
Thanks!
But no kitchen sink?
How about this one?
Hmm it seems like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any tips and hints for inexperienced blog writers? I’d certainly appreciate it.
Thanks for the comment!
If you’re a newbie blogger, have a look at Blogging to the Bank – it will show you
how to make money with blogging.
How do you setup dual monitors with KDE and FreeBSD?
This might help.
http://www.kattz.com/showthread.php/1272-How-do-you-setup-dual-monitors-with-KDE-and-FreeBSD
Webmaster, I am the admin at SEOPlugins.org. We profile SEO Plugins for WordPress blogs for on-site and off-site SEO. I’d like to invite you to check out our recent profile for a pretty amazing plugin which can double or triple traffic for a Worpdress blog. You can delete this comment, I didn’t want to comment on your blog, just wanted to drop you a personal message. Thanks, Rich
Hi Rich
Thanks for your comment / message.
No worries – but just email me next time!
I’ll go take a look – traffic is always welcome!
Cheers
Brad
this is actually the fifth time i read the site, great article as usually! regards.
You are in reality a excellent webmaster. The website loading pace is amazing. It sort of feels that you’re doing any unique trick. Also, The contents are masterwork. you’ve performed a wonderful activity in this subject!
Thanks!
But no trickery – I just use the W3 Total Cache plugin for WordPress.
Glad you like the site!
“God gave you shoes to fit you, so put them on & wear them. Be yourself, be proud of who you are.” — Eminem
Absolutely!
Hear hear.
I have just lately started a site, the info you are offering on this web site helps me drastically.
Lesson 6 – Hosts and htdocs | | Do It Yourself Web Server / HostingDo It Yourself Web Server / Hosting is an excellent post. I am about to spend more time studying this issue.
Hey There. I stumbled upon your blog site the usage of msn. This is a quite neatly published content. I will be sure to take a note of it and get back to examine more of the practical info. Thanks for the publish. I’ll absolutely returning.
Thanks Carter!
Webmaster, I am the admin at SEOPlugins.org. We profile SEO Plugins for WordPress blogs for on-site and off-site SEO. I’d like to invite you to check out our recent profile for a pretty amazing plugin which can double or triple traffic for a Worpdress blog and we just posted a video showing the plugin in action. You can delete this comment, I didn’t want to comment on your blog, just wanted to drop you a personal message. Thanks, Rich
Hi Rich!
Thanks for your comment.
I’d like to talk more about this – perhaps I can have a review copy?
This paragraph will help the internet users for creating new web site or even a
weblog from start to end.
hello sir,this is an awesome post . .i have done with the configuration part but i am having some trouble with port forwarding , my router is UTSTARCOM UT300R2U and my internet connection is BSNL, please help me with the port forwarding part
Hi Sam
Try this page – it talks specifically about your router.
http://www.sumedh.info/articles/port-forwarding-utstarcom-ut300r2u-bsnl.html
and this one:
http://forums.pcwintech.com/index.php?topic=1250.0
and this one too:
http://www.thinkdigit.com/forum/qna-read-only/101623-port-forwarding-ut-starcom-ut300r2u.html
Hope these help – it seems others have had the same problems.
Cheers
Brad
Hello sir, if it is possible can you please explain how to create a self signed SSL certificate from openssl in an XAMPP server using windows 7.
Thank you in advance
Hi Sam
Check out this thread – its probably the best answer for you.
http://www.apachefriends.org/f/viewtopic.php?p=191151&sid=f2774f42cbe41990901c4e1d7090349e
Cheers
Brad
My partner and I stumbled over here different website and thought I
should check things out. I like what I see so now i’m following you. Look forward to looking into your web page yet again.
Link exсhangе is nothing else except it іs ѕimply plасіng the otheг person’s weblog link on your page at proper place and other person will also do same for you.
Amаzing! Its in fact aweѕome artiсle, Ι haνe got much cleaг idea cοncerning fгom thiѕ
article.
Hi, thank you for your posts, I found them very helpful, but still I can’t get the result.
First of all, after I secured my Apache with password as it was said in the lesson 4, I cant open my localhost, it show me the page with a message that Access is forbidden, and after this lesson my apache doesn’t start.
I’ve entered to my hosts file, and everything seemds work, I mean when I was trying to access my domain ***.myftp.biz it shows me my localhost with forbidden message.
and my httpd-vhosts.conf file is here:
#
# 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
#
# 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 block.
#
##ServerAdmin postmaster@dummy-host.localhost
DocumentRoot “D:/xampp/htdocs”
ServerName localhost
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
##ServerAlias www.dummy-host.localhost
##ErrorLog “logs/dummy-host.localhost-error.log”
##CustomLog “logs/dummy-host.localhost-access.log” combined
##ServerAdmin postmaster@dummy-host.localhost
DocumentRoot “D:/webserver”
ServerName ***.myftp.biz
Options ExecCGI FollowSymLinks Includes Indexes
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
##ServerAlias www.dummy-host.localhost
ErrorLog “D:/webserver/logs/error_log.txt”
CustomLog “D:/webserver/logs/access_log.txt” common
##
##ServerAdmin postmaster@dummy-host2.localhost
##DocumentRoot “D:/xampp/htdocs/dummy-host2.localhost”
##ServerName dummy-host2.localhost
##ServerAlias www.dummy-host2.localhost
##ErrorLog “logs/dummy-host2.localhost-error.log”
##CustomLog “logs/dummy-host2.localhost-access.log” combined
##
Hi asem
Thanks for your comment.
To tell you the truth, I’ve moved off XAMPP on Windows now and am running the diyws.ath.cx server off Ubuntu Server 10.04.
As far as I can remember, I wrote these posts as I was installing and testing the procedures – I will need to setup a virtual environment to go back over and test what I wrote, but I’m pretty sure I wouldn’t have posted the lesson before I tested it. As I said, everything worked for me as I wrote it.
That being said:
You say “after I secured my Apache”….
Lesson 4 was about securing MySQL, not Apache.
And then you say “after this lesson, my Apache doesn’t start”
Your vhosts file “looks” ok to me – anyway, I’d love to help, so send me an email!
I also see that you’ve subscribed to the DIYWS mailing list. I have your email address, so I’ll send you an email.
Lastly, THANKS!
Cheers
Brad
hello there, you have a great article, I already followed the steps before and was able to published my site in the internet. But today I have encountered this problem.
I would like to publish a site using a USB Globe Tattoo Stick modem plug into my laptop. When I configure the hosts file. I am stuck with this.
127.0.0.1 localhost
_______ myevaluation.no-ip.org
I open the command prompt, and type ipconfig, I see these lines
PPP adapter Globe Tattoo Broadband – Postpaid:
Connection-specific DNS Suffix . :
IPV4 address …………………………. : 10.88.114.127
Subnet mask ………………………….. : 255.255.255.255.0
Default Gateway ……………………. : 0.0.0.0.0
Is the IP adress 10.88. 114.127 the one I should place in the blank above?
Hi Rene
Yes, exactly.
And of course, the IP address will change each time you get a new internet connection via your USB modem,
so you’ll have to update your hosts file and work via the URL only while you’re connected.
Cheers
Brad