troubleshooting Question

can't connect to server from within LAN

Avatar of BAJ05
BAJ05Flag for France asked on
Linux Networking
3 Comments1 Solution311 ViewsLast Modified:
I posted the following in the postgresql section but I believe now this is more related to networking issues since I can't connect to the server via http as well from within the LAN.
I read a little bit on VirtualHost in httpd but I am lost there, too.

Here is my httpd.conf:

ServerTokens OS

ServerRoot "/etc/httpd"

PidFile "/var/run/httpd.pid"

TimeOut 300

KeepAlive on

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 100
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen *:80

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 ldap_module modules/mod_ldap.so
LoadModule auth_ldap_module modules/mod_auth_ldap.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 deflate_module modules/mod_deflate.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 mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.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 dav_fs_module modules/mod_dav_fs.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
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so

Include conf.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

ServerName 11.22.33.44

UseCanonicalName on

DocumentRoot "/var/www/html"

<LocationMatch "^/$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir "disable"

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, use this directive instead of "UserDir disable":
    #
    #UserDir public_html

</IfModule>

DirectoryIndex

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

TypesConfig "/etc/mime.types"

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>

HostNameLookups Off

EnableMMAP off

EnableSendfile off

ErrorLog "/var/log/httpd/error_log"

LogLevel notice

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


CustomLog logs/access_log combined

ServerSignature on

Alias /icons/ "/var/www/icons/"

<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<IfModule mod_cgid.c>
</IfModule>

IndexOptions FancyIndexing VersionSort NameWidth=*

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage kr .kr
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr

LanguagePriority en de nl et fr da el it ja kr no pl pt pt-br ltz ca es sv tw

ForceLanguagePriority Prefer Fallback

AddDefaultCharset ISO-8859-1

AddCharset ISO-8859-1  .iso8859-1  .latin1
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
AddCharset ISO-8859-3  .iso8859-3  .latin3
AddCharset ISO-8859-4  .iso8859-4  .latin4
AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb
AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5        .Big5       .big5
AddCharset WINDOWS-1251 .cp-1251   .win-1251
AddCharset CP866       .cp866
AddCharset KOI8-r      .koi8-r .koi8-ru
AddCharset KOI8-ru     .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8       .utf8

AddCharset GB2312      .gb2312 .gb
AddCharset utf-7       .utf7
AddCharset utf-8       .utf8
AddCharset big5        .big5 .b5
AddCharset EUC-TW      .euc-tw
AddCharset EUC-JP      .euc-jp
AddCharset EUC-KR      .euc-kr
AddCharset shift_jis   .sjis

AddType application/x-tar .tgz

AddHandler imap-file map

AddHandler type-map var

AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully

LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"

NameVirtualHost 192.168.0.5
<VirtualHost 192.168.0.5>
ServerName 192.168.0.5
</VirtualHost>

<VirtualHost *>
        ServerSignature email
        DirectoryIndex  index.php index.html index.htm index.shtml
        LogLevel  warn
        HostNameLookups off
</VirtualHost>

<Directory "/">
        Options FollowSymLinks
        AllowOverride None
</Directory>

<Directory "/var/www/html">
        Options Indexes Includes FollowSymLinks
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/var/www/cgi-bin">
        Options ExecCGI
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>
     
Include /OME/conf/httpd.ome.conf


=====================
Request in postgresql group:


Request: I need help accessing my postgres database from another computer outside of my router

I have postgresql 7.4 running on FC4
I have two computers behind a router that are in the 192.168.0.x ip address space, one is the postgresql server (192.168.0.5) and the other one we can call client  (192.168.0.8).
The IP address for the router is lets say: 11.22.33.44
using pgAdminIII I can access template1 from the client using the 192.168.0.5 address.
I cannot do this using the 11.22.33.44 address (all same parameters otherwise) from the client = PROBLEM
etherreal tells me that there is a request coming from the client on port 5432 (postgres) from 11.22.33.44
When I try to connect from a totally different computer I have no problem accessing it.
Then what might be of interest is also the router configuration. Here is the port forwarding table:
22, 22389-3399, 80, 5000-7000, 111,139, 443 -> 192.168.0.8


I basically know nothing about postgresql, so please explain in detail what I have to do to give you missing information.

The above tells me that postgres is running and working. I can access the database from outside, and a request is patched through the router to the server. Since ethereal sees the request it shouldn't be a firewall issue or something alike. To me the only solution lies in the configuration of postgres. As far as I know the only place to configure the server is through the pg_hba.conf file that lies in /var/lib/pgsql/data.

Here is mine (I played around with it and wanted to open up everything just to get it work and then slowly close it again.

# IPv4-style local connections:
host    all         all         127.0.0.1         255.255.255.255   md5
host    all         all         192.168.0.0/24                      md5
host    all         all         11.22.33.44/24        md5
host    all         all         192.168.0.0/0                       md5
# IPv6-style local connections:
#host    all         all         ::1               ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff        trust

#local  all    all           ident sameuser
local all all md5


pg_ident.conf is empty

and here is my postgresql.conf file (only parts without #)

tcpip_socket = true
max_connections = 100
port = 5432
authentication_timeout = 60     # 1-600, in seconds
password_encryption = true
shared_buffers = 1000           # min 16, at least max_connections*2, 8KB each
lc_messages = 'en_US.UTF-8'             # locale for system error message strings
lc_monetary = 'en_US.UTF-8'             # locale for monetary formatting
lc_numeric = 'en_US.UTF-8'              # locale for number formatting
lc_time = 'en_US.UTF-8'                 # locale for time formatting

Thanks for your kind help

Bernd
ASKER CERTIFIED SOLUTION
David Piniella

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros