Web server directing to the main login page

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
ParityBit
Starting out
Posts: 46
Joined: Mon Aug 17, 2015 9:35 pm

Web server directing to the main login page

Post by ParityBit » Thu Jun 27, 2019 6:55 am

Hi All,

TS-451, 8 GB RAM, Firmware 4.3.6.0979

No idea what happened, but now my web server which was working points to my main web interface unless I put a /index.html after my domain name. It was never this way before. I read online to remove the index.php from the /Web folder which I did, but that did not help.

Any ideas?

Thank you

azaroth01
Starting out
Posts: 12
Joined: Tue Aug 13, 2019 5:38 pm

Re: Web server directing to the main login page

Post by azaroth01 » Wed Aug 14, 2019 4:42 am

Same thing is startling me. This seems to be a recurring issue with QNAP since years and I am stymied as I must be overlooking something that should jump in my face. Or am I?

I seem to be unable to use the virtual host functionality and see that this has been happening since years without being able to find the reason or the solution. I would appreciate some help to find how to get the virtual host show my websites instead of the index.php in /Web.

Setup:

I have two sites using WordPress, one in the default location /share/CE_CACHEDEV1_DATA/Web/WordPress and the other one in a subdirectory of /share/CE_CACHEDEV1_DATA/Web/wp-tmd/wordpress (separately installed but using the same database).

The virtual host is running listening on ports 8082 and 8083 pointing to these directories, each one having their respective index.php at the ready.

When connecting from the web, the result is always showing the /share/CE_CACHEDEV1_DATA/Web/index.php content (which I have edited to show the same lovely picture as pwilson has kindly mentioned, in order to avoid the recurring redirect to the QNAP admin access screen.
Just adding some info for better understanding. This is the content of my httpd-ssl-vhosts-user.conf, that my QNAP generated:

NameVirtualHost *:8082

Listen 8082

<VirtualHost *:8082>
<Directory "/share/Web/WordPress">
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerName REDACTED.ch
DocumentRoot "/share/Web/WordPress"
SSLEngine on
SSLCipherSuite EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:!MD5
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile "/etc/stunnel/stunnel.pem"
</VirtualHost>
A curl to port 8082 results in:
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
a curl -v https://REDACTED.ch:8081 results in
* Rebuilt URL to: https://REDACTED.ch:8081/
* Trying 37.24.108.230...
* TCP_NODELAY set
* Connected to REDACTED.ch (xx.xx.xx.xx) port 8081 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=REDACTED.ch
* start date: Aug 12 21:06:00 2019 GMT
* expire date: Nov 10 21:06:00 2019 GMT
* subjectAltName: host "REDACTED.ch" matched cert's "REDACTED.ch"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x562a4f74fda0)
> GET / HTTP/1.1
> Host: rothpartners.ch:8081
> User-Agent: curl/7.52.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< date: Tue, 13 Aug 2019 11:29:58 GMT
< server: Apache
< x-frame-options: SAMEORIGIN
< vary: Accept-Encoding
< content-type: text/html; charset=UTF-8
<
* Curl_http_done: called premature == 0
* Connection #0 to host REDACTED.ch left intact
<img src="http://i40.tinypic.com/avqurc.gif" border=0>

I was expecting the wordpress site to come up, but instead the /Web/index.php is called.

What am I doing wrong?

(TVS 473, FW 4.3.6.0993)

User avatar
Toxic17
Ask me anything
Posts: 5158
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: Web server directing to the main login page

Post by Toxic17 » Wed Aug 14, 2019 5:46 am

so using the built in Web Server feature you are limited to the constraints of what QNAP have added. If you want to load a different page than index.php then use the .htaccess file and its parameters oh btw, if you going to run a web server then read up a bit, its not just plug and play.

you can edit internal php files etc which you could break very easily but since you know very little of how to redirect a file then start with ".htaccess" files and what it can do for your web server

clue: default handler

DirectoryIndex index.html

Google the rest since I dont have any idea on your setup or software.

once you have it setup then start to harden the server and run diagnostics on it. here are a few suggested site to check your website once its running. it will find more issues than you want, but makes a good check on understanding Apache and php.

http://www.htaccess-guide.com/directoryindex-uses/

you will need more than just one line in the htaccess file and there are some generators online that can help.

https://gtmetrix.com/

http://SSLlabs.com/ssltest/analyze.html

For securing your website I suggest at least using ZB-Block.

once you are ready let us know the URL and we can take a looksee!

https://www.conligwx.org resides on a NAS :) though not using the default web server.
Regards Simon

QTS 4.x User Guidex

QNAP Club Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-473-32GB QM2-2P QXG-10G1T 4.4.1.1064 • TVS-463-16GB 4.4.1.1064 QM2-2S10G1TB • TS-459 Pro 2GB 4.2.6 • TS-121 4.3.3.0998 • APC Back-UPS ES 700G •
QPKG's: TwonkyServer 8.51 • Apache73 • QSonarr 3.0.1.503 • QNBZGet 21.0 • phpMyAdmin 4.9.0.1 • Qmono 5.20.1.19 • McAfee 2.2.1 • Lychee 3.2.15 • HBS 3.0.190802 • LEgo v3.0.0
Network: VM Hub 3.0 <500/35> • UniFi USG Pro 4 • UniFi USW-16-150W • UniFi USW-8-60W • UniFi CloudKey Gen2+• UniFi G3-Flex • UAP AC Pro • UAP AC Lite • SLM2008 • Dell 7050 MFF •

Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”