Home server domain problem with IP address

Hi, I have a strange problem, caused by my own doing I must add.
have setup a home server and had it running for some time (over a year)
I had an issue with FTP from a PHP script accessing.
I thought the issue was related tyo External IP address so i used the Change IP function. and I seemed to have screwed up access for a domain

http://fife.uk

To begin with I couldn’t access the web site at all, but I seem to have got something back.
overall it is completely weird as I think the httpd.conf info and dns settings are looking good.
I’ve spent the best part of two days trying to resolve and wondered if any eagle eyed people can give me any clues as tio what is happening.
I setup the domain on another server and it was fine.It looks like Apache is the issue here (I thought it was just the one domain)

thanks for any help
Brian

List of /home/fifeuk/public_html


total 1044
drwxr-x— 23 fifeuk fifeuk 4096 Apr 8 08:28 .
drwxr-x— 22 fifeuk fifeuk 4096 Apr 7 23:11 …
lrwxrwxrwx 1 fifeuk fifeuk 4 Jan 22 2018 awstats-icon -> icon
lrwxrwxrwx 1 fifeuk fifeuk 4 Jan 16 2017 awstatsicons -> icon
drwxr-xr-x 3 fifeuk fifeuk 122 Feb 15 2018 css
-rw-r–r-- 1 fifeuk fifeuk 7406 Feb 15 2018 favicon.ico
-rw-r–r-- 1 fifeuk fifeuk 1710 Feb 15 2018 footer.htm
drwxr-xr-x 9 fifeuk fifeuk 93 Feb 12 2017 icon
drwxr-xr-x 12 fifeuk fifeuk 4096 Feb 15 2018 images
-rw-r–r-- 1 fifeuk fifeuk 29 Apr 7 23:21 index.html
drwxr-xr-x 4 fifeuk fifeuk 259 Feb 15 2018 js
drwxr-xr-x 2 fifeuk fifeuk 4096 Apr 7 23:11 stats

looking at https://fife.uk


Index of /
[ICO] Name Last modified Size Description
[ ] ssl.ca 2019-02-03 23:54 1.6K
[ ] ssl.cert 2019-02-03 23:54 1.9K
[ ] ssl.combined 2019-02-03 23:54 3.5K
[ ] ssl.everything 2019-02-03 23:54 5.1K
[ ] ssl.key 2019-02-03 23:54 1.6K

httpd conf settings:


SuexecUserGroup #511 #504
ServerName fife.uk
ServerAlias www.fife.uk
ServerAlias webmail.fife.uk
ServerAlias admin.fife.uk
DocumentRoot /home/fifeuk/public_html
ErrorLog /var/log/virtualmin/fife.uk_error_log
CustomLog /var/log/virtualmin/fife.uk_access_log combined
ScriptAlias /cgi-bin/ /home/fifeuk/cgi-bin/
ScriptAlias /awstats/ /home/fifeuk/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/fifeuk/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
AddHandler fcgid-script .php5.6
FCGIWrapper /home/fifeuk/fcgi-bin/php5.6.fcgi .php
FCGIWrapper /home/fifeuk/fcgi-bin/php5.fcgi .php5
FCGIWrapper /home/fifeuk/fcgi-bin/php5.6.fcgi .php5.6
Require all granted

<Directory /home/fifeuk/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.fife.uk
RewriteRule ^(.) https://fife.uk:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.fife.uk
RewriteRule ^(.
) https://fife.uk:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
RemoveHandler .php5.6
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
Alias /dav /home/fifeuk/public_html
ProxyPass /dav/ !
ProxyPassReverse /dav/ !
<Location /dav>
DAV on
AuthType Basic
AuthName fife.uk
AuthUserFile /home/fifeuk/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off

<Proxy *>
allow from all


AuthName “fife.uk statistics”
AuthType Basic
AuthUserFile /home/fifeuk/.awstats-htpasswd
require valid-user

php_value memory_limit 32M
IPCCommTimeout 31
SSLEngine on
SSLCertificateFile /home/fifeuk/ssl.cert
SSLCertificateKeyFile /home/fifeuk/ssl.key
SSLCACertificateFile /home/fifeuk/ssl.ca
SSLProtocol ALL +TLSv1 +TLSv1.1 +TLSv1.2

[root@nsh fifeuk]# ls -al ssl*


-rwxr-xr-x 1 fifeuk fifeuk 1647 Mar 23 14:22 ssl.ca
-rwx------ 1 fifeuk fifeuk 3555 Mar 23 14:22 ssl.cert
-rwx------ 1 fifeuk fifeuk 5204 Mar 23 14:22 ssl.combined
-rwx------ 1 fifeuk fifeuk 6880 Mar 23 14:22 ssl.everything
-rwx------ 1 fifeuk fifeuk 1675 Mar 23 14:22 ssl.key

DNS Records


$ttl 60
@ IN SOA nsh.fife.biz. admin.fife.uk. (
1516649614
10800
3600
1209600
38400 )
fife.uk. IN A 81.174.249.151
ns.fife.uk. IN A 81.174.249.151
www.fife.uk. IN A 81.174.249.151
ftp.fife.uk. IN A 81.174.249.151
m.fife.uk. IN A 81.174.249.151
ns.fife.uk. IN A 81.174.249.151
localhost.fife.uk. IN A 127.0.0.1
webmail.fife.uk. IN A 81.174.249.151
admin.fife.uk. IN A 81.174.249.151
mail.fife.uk. IN A 81.174.249.151
fife.uk. IN MX 5 mail.fife.uk.
fife.uk. IN TXT “v=spf1 a mx a:fife.uk ip4:81.174.249.151 -all”
default._domainkey.fife.uk. IN TXT “v=DKIM1; k=rsa; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtObSvZaNoUV9Q” vB/1j68fVnRbEI2FfVBrL/lKW0gHcP4DUAax+M2fE7OOYT8iNrejlk6ljbTSVg1VSMYbET9knGVUo39K LFwy+jrGj9MbE4WRk798VY7C1WUrkS6r1s5PtkoBg9PBEzNlDBqpZqGUeuZ/P5+4O8RKcgqA10BhPzfo JZJp9l3eOwDdfNIWS9P7snK2Zir7mcLJYTbrAHZd3H7oMIkCSU12kOa5Ao+kPj1mBrPPC1r5donFFL7q m1nNH0HVxMPKVIS5TD1D8vlygK3yvDrX2YTh2fyX+SBK+n5IJzsEnGpuhQ+GnEgFFHrZxKZFfY4YkZxS 1SuTZwaWQIDAQAB
_dmarc.fife.uk. IN TXT “v=DMARC1; p=none; pct=100; ruf=mailto:postmaster@fife.uk; rua=mailto:postmaster@fife.uk
_token._dnswl.fife.uk. 60 IN TXT cvl872nik5jljv5frxscfxye3i40wwb9
fife.uk. IN NS nsh.fife.biz.

also the https://fife.uk


Secure Connection Failed

An error occurred during a connection to fife.uk. PR_END_OF_FILE_ERROR

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the web site owners to inform them of this problem.

Learn more…

I think the issue seems to be with SSL and Apache.
so I disabled SSL for website,
I now see the standard html file at the domain http://fife.uk

so I enabled SSL for website and then get this error:

Adding new SSL virtual website ..
.. certificate file is not valid : Line 31 does not look like PEM format

not sure yet where it is leading me.
Brian

well, it looks like documenting it here has helped me solve the problem :o)

after trying to create the SSL website again and the error,
I deleted the SSL files.
created the SSL website again and cretaed SSL self signed certificates

all working again.

well, not it’s stopped working again. :o(
http://fife.uk is not accessible
seems that the IP address has set back to the internal IP instead of the external IP, I don’t understand why it would have changed (after all I had just tested it a few minutes agoe ;o) )

Virtual Server 192.168.1.70 80 fife.uk /home/fifeuk/public_html

this gets weirder.
https://nsh.fife.biz:10000/virtual-server/link.cgi/192.168.1.70/http://www.fife.uk/

shows the contents of /var/www/html.

hopefully you can see from above that the DocumenetRoot points to correct location. DocumentRoot /home/fifeuk/public_html

so something must be screwing up document root pointer
I though with the years I’ve been working on this that I understoof where things were lcoated, but shows you how wrong I am ;o)

You can see the documentroot in either virutalmin or directly at the vhost file from apache2.
You can check the IP inside virutalmin too (or directly again in the vhost file).
Go to your problematic server and then click on server configuration -> change IP address.
There you can see if which address is used or if something is wrong.

Thanks, been in there and can’t see any problems
I tried changes this morning and made it worse :see_no_evil:

Have got back to what I think should be right.
Another domain http://nsh.fife.biz
Works, so I think I understand what’s needed, but I’m missing something as https://fife.uk is not working

Thsnks

I realised my error when I saw /var/www/html

I used the wrong IP address (external) and so docroot wasn’t found

I found something.

the PHP 5.6 configuration had the following, instead of just fifeuk. I kind of know how that happened as I renamed domand and back again (but the name went to ‘fife’ instead of ‘fifeuk’ so I renamed it ‘fifeuk’ but somehow it got renamed ‘fifeukuk’
I’m going to restart the server and see if that gets it working now.

upload_tmp_dir = /home/fifeukuk/tmp

I’m thinking now that issue is with DNS server
I’m still looking

SOLVED.

the issue was with my Broadband Router. the passthrough for some functions such as DNS and FTP were broken.
I’m nlot sure why it was an issue byt resolved now.

I perhaps should have seen that problem earlier but becaus I had changed something on server I concentrated my efforts there.

I will remember in future ;o)

thanks for looking and helping.
regards Brian

This topic was automatically closed 14 hours after the last reply. New replies are no longer allowed.