Apache 2.4 on DS218+

Currently reading
Apache 2.4 on DS218+

2
2
NAS
DS218+
I'd like to run Apache server on my DS218+. I need it only inside the home network. I don't need Wordpress/Joomla etc.
I only need Apache for presentation a simple static content.
I have experience with AIX and running Apache.
I installed package Apache 2.4, Web station say Apache is running, I see some Apache processes:
ps -ef|grep http
root 18277 1 0 Oct29 ? 00:00:02 /var/packages/Apache2.4/target/usr/local/bin/httpd24
http 18467 18277 0 Oct29 ? 00:00:00 /var/packages/Apache2.4/target/usr/local/bin/httpd24
http 18570 18277 0 Oct29 ? 00:00:00 /var/packages/Apache2.4/target/usr/local/bin/httpd24

But I do'nt know where is DocumentRoot of Apache. Synology support claims that -> /volume1/web
I have inside this dir:
DS218:/volume1/web$ ls -l
drwxrwxrwx+ 1 root root 8 Oct 25 21:01 @eaDir
-rwxrwxrwx+ 1 http http 1474 Oct 25 21:01 index.html

I try to responce of Apache...
wget --spider -O - http://localhost/index.html
I receive this:
Spider mode enabled. Check if remote file exists.
--2019-10-30 19:23:49-- http://localhost/index.html
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
--2019-10-30 19:23:50-- (try: 2) http://localhost/index.html
Reusing existing connection to localhost:80.
HTTP request sent, awaiting response... 500 Internal Server Error
Remote file does not exist -- broken link!!!

Synology support couldn't advise me.
Somebody will advise me here, what I doing wrong?
 
1,817
758
NAS
DS220+ : DS1019+ : DS216+II : DS118 : DS120j : APC Back UPS ES 700 — Mac/iOS user
Hi roze

I should start by saying I don’t know much about web servers but I’ve managed to run a simple website by using web station and Apache 2.2.
In my case everything went under a folder called Web (when you run FileStation you should see it). It’ll be your NAS name and then among the folders should be “web”.
Under web, I have folder “CSS” where all the CSS files went when I used my web publishing application to do the magic.

Not sure if this helps. If not, more knowledgeable members will surely jump in.
 
1,817
758
NAS
DS220+ : DS1019+ : DS216+II : DS118 : DS120j : APC Back UPS ES 700 — Mac/iOS user
Come to think of it. Maybe the folder “web” was created by the publishing software.
I just played stupid and directed my web design software to my NAS with the following settings and it worked. In fact I was surprised when it did :D

CDEF190B-DF0F-43B9-BD96-47FF030342E8.jpeg
 

fredbert

Moderator
NAS Support
Subscriber
2,155
869
NAS
DS1520+, DS218+, DS215j
Router
  1. RT2600ac
  2. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Last edited:
The default shared folder for Web Station document root is /web.

In Web Station you can set it's default engine nginx, Apache 2.2, or Apcahe 2.4 (if installed). Also you can configure virtual hosts that can have their own engines and doc root in any other folder on the NAS.

My setup has Web Station redirecting HTTP to HTTPS though where I set this I have absolutely forgotten (for 01:30 and I'm tired). In Control Panel / Network / DSM Settings it says that the HTTP-to-HTTPS setting on that page doesn't affect Web Station, yet I can't at-the-mo find where else it was set.

UPDATE

Found my redirect, it's in the top-level .htaccess file ...

Apache config:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
 
1,817
758
NAS
DS220+ : DS1019+ : DS216+II : DS118 : DS120j : APC Back UPS ES 700 — Mac/iOS user
Yes. That’s it. @fredbert explanation is better and more “scientific”. I did the rewrite directives in .htaccess too at the time.

I found a web development application called Sparkle (I think it’s Mac only), that was absolutely a delight to use to build our simple content site (might be useful to someone stumbling on this thread). Just be careful if you go for the basic license, you can only publish to a single site.
 
2
2
NAS
DS218+
Thank you for all the advice. First I checked the existence and content of shared folder /web.
I want to use Apache 2.4 because v.2.2 is deprecated.
I don't need PHP, but Web station says 'Default server status: Abnormally' until I installed PHP (I choose 7.3).
Then Web station changes 'Default server status:' to Normal.

I found the location of Apache 2.4 conf file (/var/packages/Apache2.4/target/usr/local/etc/apache24/conf/httpd24.conf).

I found out also the location of the Apache error log (/var/packages/Apache2.4/target/usr/local/etc/apache24/logs/apache24-error_log).

during Apache startup from Web station I see in this error log message:
2019-11-09T16:23:07+01:00 DS218 [Sat Nov 09 16:23:07.741610 2019] [core:alert] [pid 528:tid 140265219294976] [client 192.168.100.2:54286] /var/services/web/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

=> DocumentRoot in may case is not in /volume1/web
but in /var/services/web/

I renamed (blocked use) of /var/services/web/.htaccess and voila ...
wget -O - http://localhost
respectively out of my DS218:
wget -O - http://ds218.local
works :)
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Similar threads

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Top