LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-10-2015, 05:12 PM   #1
jathan
LQ Newbie
 
Registered: Mar 2015
Location: Mexico City
Distribution: Debian 8 Jessie
Posts: 10

Rep: Reputation: Disabled
Problem accesing to PHP Web Site with its domain name and public IP address


Hello community. I have installed TeamPass Collaborative Passwords Manager in a CentOS 6.5 Server, but when I try to access to its web site hosted in a Apache server that I administrate with a domain name registered and managed from an external DNS server and one public IP address assigned, TeamPass always redirect me to the public IP address of the web server instead of keep the domain name in the address field of my web browser. Its only happens with this site because anyone of the rest respects the domain name in the web browser when I enter to the main page of them. I tried also setting up the VirtualHost part for TeamPass in httpd.conf file, but still the same problem of domain name using Firefox, Chromium or any browser in any client computer. If I enter to TeamPass with or without VirtualHost configuration in httpd.conf file using Chromium, shows the next code before dispaly the TeamPass login interface (in Firefox or Iceweasel happens the same but without showing the code):

https://cloud.githubusercontent.com/...97c027694b.png

Even trying with another web site that use an index.php hosted in my web server (like TeamPass in /TeamPass-master directory) this works perfectly using the domain name without redirecting to the public IP address. Can you help to find some solution please? Thanks.
 
Old 04-01-2015, 12:18 PM   #2
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
Is the problem when accessing the site from the same box, or another workstation on your network? How does it act from outside your network?

Travis
 
Old 04-01-2015, 03:30 PM   #3
jathan
LQ Newbie
 
Registered: Mar 2015
Location: Mexico City
Distribution: Debian 8 Jessie
Posts: 10

Original Poster
Rep: Reputation: Disabled
Hi Travis. Thank you very much for your answer. Yes, we can access to our TeamPass web site outside of our network. In recently days I have trying configurate a redirect implementation from the server private_IP_address to TeamPass web site domain name (for the domain name kept always in the browser address field, redirecting public IP address using the private IP to the domain name as a virtual host within Apache). VirtualHosts in httpd.conf have the next content:

NameVirtualHost private_IP_number:80

<VirtualHost private_IP_number:80>
ServerAdmin admin@company.net
ServerName private_IP_number
Redirect / http://teampass_website_domain_name/
# ServerAlias teampass_website_domain_name
# DocumentRoot /var/www/html/
ErrorLog /var/log/httpd/teampass_website_domain_name_resumed.log
CustomLog /var/log/httpd/teampass_website_domain_name_resumed.log common
DirectoryIndex index.php
<Directory /var/www/html/TeamPass-master/>
Options FollowSymLinks Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost teampass_website_domain_name:80>
ServerAdmin admin@company.net
ServerName teampass_website_domain_name
# ServerAlias teampass_website_domain_name
DocumentRoot /var/www/html/
ErrorLog /var/log/httpd/teampass_website_domain_name_resumed.log
CustomLog /var/log/httpd/teampass_website_domain_name_resumed.log common
DirectoryIndex index.php
<Directory /var/www/html/TeamPass-master/>
Options FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

So this way after restart or reload Apache and when I enter to the TeamPass web site domain name adding /TeamPass-master/ (teampass_website_domain_name/TeamPass-master/), the web browser finally keeps the domain name in the address field, but randomly Apache disconect me or deny access to the any of the web sites allowed in our server (besides TeamPass web site). Does this actually be a problem in some php file of TeamPass (like index.php) or something I am missing in the configuration of the virtual hosts?

Last edited by jathan; 04-01-2015 at 03:31 PM.
 
Old 04-01-2015, 04:29 PM   #4
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
In the past when I have had problems where a virtual host of mine was acting perfectly from outside the network but was having issues inside it has always been a networking issue. Or at least it has been in my cases.

Not to go too far into it but I had issues where I had a block of 5 static IPs the lan was on 1 Public IP and my apache was on another. I was having a "NAT" issue at my firewall not letting traffic loop back in.

But before we get too deep into NAT issues, are you running your own DNS server on the network? If so You could edit your local DNS to resolve the apache server with its private IP, if it has a private address that is.

Could you supply your network map. Router IP and type / Apache IP / Local net?

Travis
 
Old 04-01-2015, 06:08 PM   #5
jathan
LQ Newbie
 
Registered: Mar 2015
Location: Mexico City
Distribution: Debian 8 Jessie
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks for sharing your experiences Travis. No, the DNS server is an external one and it is administrated through Plesk of Paralells Virtuozzo. All is Ok, because the administrator of it showed me the fields of record type, domain name and IP address (correspondig this to our public IP address for TeamPass Server). We can not change the public IP for the private IP of TeamPass Server in DNS Server (Plesk) because this is located in an external Data Centre.
 
Old 04-01-2015, 10:22 PM   #6
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
Ok I understand, but try this first and depending if this works I will have another solution for you. On one of the client computers in your network either in Linux or Windows add a entry to your hosts file. This way you are able to make sure you are not having a routing problem and your virtualhost will still respond properly. This is only an internal change and won't affect your public DNS/

For Example
Code:
192.168.1.10       teamviewer.yourdomain.com
On a Linux workstation the file is located /etc/hosts

On a windows Station its a little more difficult to edit due to permissions.


Travis
 
Old 04-06-2015, 09:58 AM   #7
jathan
LQ Newbie
 
Registered: Mar 2015
Location: Mexico City
Distribution: Debian 8 Jessie
Posts: 10

Original Poster
Rep: Reputation: Disabled
Hello Travis. Thank you very much for your reply. I have already in hosts file a line with the private IP address of the server and the domain in right. Since the beginning I was having this. Is there another alternative please?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server with public IP address not reachable via domain name in the web browser floorripper Linux - Server 11 08-09-2013 09:55 PM
Need help with accessing Web site on same network using domain name? Woogieman Linux - Networking 8 03-31-2010 07:21 AM
How to access web site from Internert using static public IP satishmali1983 Linux - Networking 3 06-15-2009 01:51 AM
Domain Name, Web Site Hosting and Apache fusion1275 Linux - Server 2 01-15-2009 05:10 AM
Config registar DNS to point to my public IP for web site vdi_nenna Linux - Networking 3 11-23-2004 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration