Jump to content

Running 3 websites on one Linux machine ?


Relic2K
 Share

Recommended Posts

ahhh then it is a dns issue

you need to get your websites pointed to your machine at the DNS hoster.

also you have 192.168.0.1 as an IP address in those examples .. is that the actual IP address of the machine ??? coz then it could be a routing issue

 

I'll explain what I have ....

I have a cable plugged into a router (computer) with two network cards

card 1 = IP 202.27.218.97

card 2 = 192.168.1.1

 

on my router (running Mandrake MNF) I have port forwarded port 80 to 192.168.1.2

 

the web server has IP address 192.168.1.2

 

the other thing that can affect this working is DNS

paul@trinity paul $ dig loudas.com


;; QUESTION SECTION:
;loudas.com.                    IN      A


;; ANSWER SECTION:

loudas.com.             43200   IN      A       202.27.218.97

paul@trinity paul $

notice that the answer section returns my PUBLIC IP address ???

 

if your interested in the actual DNS record .. here it is

; Authoritative DNS data for radiopie.com
;
; Location:       External (Internet)
; Comments:



$ttl 43200



@               IN      SOA     ns1.loudas.com. netadmin.loudas.com. (

                               2003031701     ; serial

                               10800  ; refresh

                               3600   ; retry

                               604800 ; expire

                               43200 ); minimum TTL



@               IN      NS      ns1.loudas.com.

@               IN      NS      ns2.loudas.com.



cipher          86400   IN      A       202.27.218.96



mail            172800  IN      A       202.27.218.97

@                       IN      A       202.27.218.97

www                     IN      A       202.27.218.97

irc                     IN      A       202.27.218.97

webmail                 IN      A       202.27.218.97

dragon                  IN      A       202.27.218.97

wapdomainz              IN      A       202.27.218.97

w3                      IN      A       202.27.218.97

pop3                    IN      A       202.27.218.97

smtp                    IN      A       202.27.218.97

ns1                     IN      A       202.27.218.96

ns2                     IN      A       202.27.218.97



loudas.com.     86400   IN      A       202.27.218.97

               86400   IN      MX 0    mail.loudas.com.

Link to comment
Share on other sites

Here is my Dig output, also that is the IP Address of the my Server, 192.168.0.2, my linksys router is 192.168.0.1, so I can't use that address.

 

dig no-ip.org

 

; <<>> DiG 9.2.2 <<>> no-ip.org

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61003

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3

 

;; QUESTION SECTION:

;no-ip.org. IN A

 

;; ANSWER SECTION:

no-ip.org. 60 IN A 66.185.162.98

 

;; AUTHORITY SECTION:

no-ip.org. 42571 IN NS nf1.no-ip.com.

no-ip.org. 42571 IN NS nf2.no-ip.com.

no-ip.org. 42571 IN NS nf3.no-ip.com.

 

;; ADDITIONAL SECTION:

nf1.no-ip.com. 17090 IN A 66.185.166.131

nf2.no-ip.com. 17090 IN A 66.185.162.100

nf3.no-ip.com. 1436 IN A 216.66.37.10

 

;; Query time: 40 msec

;; SERVER: 68.10.16.25#53(68.10.16.25)

;; WHEN: Tue Mar 25 08:16:31 2003

;; MSG SIZE rcvd: 163

Link to comment
Share on other sites

Here is what I did eventually to get all 3 sites accessible from the the Internet. The only config file I added the Virtual Host Directives to, was the httpd2.conf file. Note what I did comment out though;

__________________________________________________________

### Main Configuration Section

### You really shouldn't change these settings unless you're a guru

###

#ServerType standalone

ServerRoot /etc/httpd/2.0

#ServerName 192.168.0.2

#LockFile /etc/httpd/httpd.lock

PidFile /var/run/httpd.pid

ErrorLog logs/error_log

LogLevel warn

#DocumentRoot /var/www/html

HostnameLookups on

ServerAdmin me@email.com

ServerTokens Prod

 

 

### Dynamic Shared Object (DSO) Support

###

### You should always leave those three, as they are needed for

### normal use.

### mod_access (Order, Allow, etc..)

### mod_log_config (Transferlog, etc..)

### mod_mime (AddType, etc...)

 

LoadModule access_module modules/mod_access.so

LoadModule auth_module modules/mod_auth.so

LoadModule auth_anon_module modules/mod_auth_anon.so

##LoadModule auth_dbm_module modules/mod_auth_dbm.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule include_module modules/mod_include.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule env_module modules/mod_env.so

##LoadModule mime_magic_module modules/mod_mime_magic.so

##LoadModule cern_meta_module modules/mod_cern_meta.so

LoadModule expires_module modules/mod_expires.so

LoadModule headers_module modules/mod_headers.so

LoadModule usertrack_module modules/mod_usertrack.so

##LoadModule unique_id_module modules/mod_unique_id.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule proxy_module modules/mod_proxy.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 mime_module modules/mod_mime.so

LoadModule status_module modules/mod_status.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule asis_module modules/mod_asis.so

LoadModule info_module modules/mod_info.so

LoadModule cgi_module modules/mod_cgi.so

##LoadModule cgid_module modules/mod_cgid.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule dir_module modules/mod_dir.so

LoadModule imap_module modules/mod_imap.so

LoadModule actions_module modules/mod_actions.so

##LoadModule speling_module modules/mod_speling.so

LoadModule userdir_module modules/mod_userdir.so

LoadModule alias_module modules/mod_alias.so

LoadModule rewrite_module modules/mod_rewrite.so

 

##New Modules for 2.0 (some are experimental)

##LoadModule file_cache_module modules/mod_file_cache.so

##LoadModule echo_module modules/mod_echo.so

##LoadModule charset_lite_module modules/mod_charset_lite.so

##LoadModule cache_module modules/mod_cache.so

##LoadModule disk_cache_module modules/mod_disk_cache.so

##LoadModule mem_cache_module modules/mod_mem_cache.so

##LoadModule ext_filter_module modules/mod_ext_filter.so

##LoadModule case_filter_module modules/mod_case_filter.so

##LoadModule case_filter_in_module modules/mod_case_filter_in.so

##LoadModule deflate_module modules/mod_deflate.so

##LoadModule optional_hook_export_module modules/mod_optional_hook_export.so

##LoadModule optional_hook_import_module modules/mod_optional_hook_import.so

##LoadModule optional_fn_import_module modules/mod_optional_fn_import.so

##LoadModule optional_fn_export_module modules/mod_optional_fn_export.so

##LoadModule bucketeer_module modules/mod_bucketeer.so

##LoadModule logio_module modules/mod_logio.so

 

###

### Global Configuration

###

# We now support multiple apache configurations on the same server. In

# common.conf, we put all directives that are common to all implementations

# (httpd, httpd-perl, etc.)

# For Apache2 we load all conf files in conf.d

Include /etc/httpd/conf.d/*.conf

Include conf/commonhttpd.conf

 

 

###

### IP Address/Port and Proxied configuration section

###

# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you

# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that

# the fast web server serves static content while Apache handles the

# cgi or php files

 

#BindAddress *

#<IfDefine APACHEPROXIED>

# Listen 8080

#</IfDefine>

#<IfDefine !APACHEPROXIED>

# Listen 80

#</IfDefine>

Listen 9800

Listen 9700

Listen 9900

# Likewise, we can set apache as the server by default and send perl

# requests via ProxyPass to apache-mod_perl. It increases performance

# since the perl interpreter is only used for perl and the standard apache

# does all the html and image files, with a smaller footprint.

#

# If you install apache and apache-mod_perl, this is the default config.

# If you don't want two web servers to use perl, uninstall apache, and

# apache-mod_perl will not be proxied.

 

<IfDefine PERLPROXIED>

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteRule ^proxy:.* - [F]

RewriteRule ^(.*/perl/.*)$ http://%{HTTP_HOST}:8200 [P]

RewriteRule ^(.*/cgi-perl/.*)$ http://%{HTTP_HOST}:8200 [P]

</IfModule>

</IfDefine>

 

###

### Log configuration Section

###

 

<IfModule mod_log_config.c>

#Single logfile with access, agent and referer information

#This is the default, if vlogs are not defined for the main server

CustomLog logs/access_log combined env=!VLOG

#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry

CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG

</IfModule>

 

###

### Virtual Hosts

###

# We include different templates for Virtual Hosting. Have a look in the

# vhosts directory and modify to suit your needs.

Include conf/vhosts/Vhosts.conf

#Include conf/vhosts/DynamicVhosts.conf

#Include conf/vhosts/VirtualHomePages.conf

 

<VirtualHost 192.168.0.2:9700>

ServerAdmin me@email.com

ServerName site1.no-ip.org

ErrorLog logs/site1.no-ip.org_error_log

CustomLog logs/site1.no-ip.org_access_log common

DocumentRoot /var/www/html/site1

 

<Directory "/var/www/html/site1">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

<VirtualHost 192.168.0.2:9800>

ServerAdmin me@email.com

ServerName site2.no-ip.org

ErrorLog logs/site2.no-ip.org_error_log

CustomLog logs/site2.no-ip.org_access_log common

DocumentRoot /var/www/html/site2

 

<Directory "/var/www/html/site2">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

<VirtualHost 192.168.0.2:9900>

ServerAdmin me@mail.com

ServerName site3.no-ip.org

ErrorLog logs/site3.no-ip.org_error_log

CustomLog logs/site3.no-ip.org_access_log common

DocumentRoot /var/www/html/site3

 

<Directory "/var/www/html/site3">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

###

### Performance settings Section

###

#

# Timeout: The number of seconds before receives and sends time out.

#

TimeOut 300

 

#

# KeepAlive: Whether or not to allow persistent connections (more than

# one request per connection). Set to "Off" to deactivate.

#

KeepAlive on

 

#

# MaxKeepAliveRequests: The maximum number of requests to allow

# during a persistent connection. Set to 0 to allow an unlimited amount.

# We recommend you leave this number high, for maximum performance.

#

MaxKeepAliveRequests 100

 

#

# KeepAliveTimeout: Number of seconds to wait for the next request from the

# during a persistent connection. Set to 0 to allow an unlimited amount.

# We recommend you leave this number high, for maximum performance.

#

MaxKeepAliveRequests 100

 

#

# KeepAliveTimeout: Number of seconds to wait for the next request from the

# same client on the same connection.

#

KeepAliveTimeout 15

 

 

# prefork MPM [THIS IS THE DEFAULT]

# StartServers: number of server processes to start

# MinSpareServers: minimum number of server processes which are kept spare

# MaxSpareServers: maximum number of server processes which are kept spare

# MaxClients: maximum number of server processes allowed to start

# MaxRequestsPerChild: maximum number of requests a server process serves

<IfModule prefork.c>

StartServers 5

MinSpareServers 5

MaxSpareServers 10

MaxClients 150

MaxRequestsPerChild 0

</IfModule>

 

# worker MPM

# StartServers: initial number of server processes to start

# MaxClients: maximum number of simultaneous client connections

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# ThreadsPerChild: constant number of worker threads in each server process

# MaxRequestsPerChild: maximum number of requests a server process serves

<IfModule worker.c>

StartServers 2

MaxClients 150

MinSpareThreads 25

MaxSpareThreads 75

ThreadsPerChild 25

MaxRequestsPerChild 0

</IfModule>

 

# perchild MPM

# NumServers: constant number of server processes

# StartThreads: initial number of worker threads in each server process

# MinSpareThreads: minimum number of worker threads which are kept spare

# MaxSpareThreads: maximum number of worker threads which are kept spare

# MaxThreadsPerChild: maximum number of worker threads in each server process

# MaxRequestsPerChild: maximum number of connections per server process

<IfModule perchild.c>

NumServers 5

StartThreads 5

MinSpareThreads 5

MaxSpareThreads 10

MaxThreadsPerChild 20

MaxRequestsPerChild 0

</IfModule>

__________________________________________________________________

 

Removed everything from my /etc/hosts that had to do with the websites, set the VHosts.conf back to the default, which has nothing, and removed everything from the commonhttpd.conf file that I added. So the only changes were in the "HTTPD2.CONF" file.

Cheers to all for the help, and good luck for those still having problems. I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...