*DEPRECATED* Apache Web Server for unRAID 6.2


Recommended Posts

Apache Web Server 2.4.23 for unRAID 6.2 ONLY

 

Apache Web Page: http://httpd.apache.org

 

This plugin installs Apache Web Server.  Follow the steps below to install it.  Once it is installed and running, you can connect to the web server on port 8088 (or the port you picked) of your unRAID server.  Also you can click on the green "RUNNING" link from the unRAID webUI Apache settings page.  It places a httpd.conf & php.ini in /boot/config/plugins/apache/httpd.  The user/group is derived from runas.  The servername is automatically set to your unRAID server name. The DocumentRoot is linked to the directory you choose for your web pages from the webgui. So those items are commented out in the httpd.conf and initiated from the plugin. Php extensions are enabled.  I tested with phpMyAdmin, phpvirtualbox and GLPI

 

Copy this link and paste in the Install Plugin form in the Plugins menu of the unRAID webgui. Then click install.

https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/apache.plg
 

After install go to Settings then Web Server

Here you can change the settings for the plugin

 

Plugin Settings

Install Directory: Directory where your Web Pages will be.  Should be changed to a Cache Only share or a non-array  mounted drive for permanent settings. Port: Port on your unRAID server where you access Web Server. Default is 8088. (ie.  HTTP://TOWER:8088) Run as User: The user you wish to run plugin as (nobody or other unRAID user cannot be root)

 

Select Install to install. Then Start to Start, Stop to Stop and so on

Runas user cannot be root.

 

All comments and sugestions are welcome.

 

Thanks to Inflencer for the plugin templates based on Benni-Chan's plugin structure, bobbintb, and all those on this site that I might have borrowed from to make this plugin.

 

Thanks to Kx2000 for helping debug the plugin.

 

Included reverse proxy hosts. Just uncomment "Include /boot/config/plugins/apache/proxiedhosts" in /boot/config/plugins/apache/httpd.conf and edit  /boot/config/plugins/apache/proxiedhosts to your liking

 

Included SSL.  Just uncomment "Include /boot/config/plugins/apache/httpd-ssl.conf" in /boot/config/plugins/apache/httpd.conf and edit /boot/config/plugins/apache/httpd-ssl.conf with your ServerName instead of example.com and if needed run /boot/config/plugins/apache/cert.sh to create a server.crt.  Just follow the prompts.  With SSL enabled apache won't start without a /boot/config/plugins/apache/server.crt

 

For installs prior to 2015.04.21 you need to change "short_open_tag" to "On" in /boot/config/plugins/apache/httpd php.ini in order for phpvirtualbox, phpMyAdmin and others that use php short cut codes <? code ?> instead of full <?php code ?> to work.

 

Change Log

###2017.01.28

- update apache to 2.4.25

- update php extensions to 5.6.29

- update libX11, libxcb, libXpm, net-snmp packages

- fix: harfbuzz package for 6.3

- harden code for XSS and CSRF vulnerabilities

- minor code improvements

###2016.10.26

- fix: harfbuzz package for 6.2

###2016.10.24

- fix: docroot permissions on service start

- add: browser based config editor for conf files and php.ini

- add: search functions to editor

- add: drop down list of users

###2016.10.15

- add: min and max version to plg

- update php extensions to 5.6.26 match unRAID 6.3

###2016.09.24

- fix: apr and apr-util packages not installing

- fix: clearing log files

- add: restart button

- add: missing dependencies for gd.so

###2016.09.17a

- fix: php.ini not being used

- update php extensions to 5.6.24 match unRAID 6.2

###2016.09.17

- update plugin for 6.2 only

###2015.09.07

- fix start and stop scripts

###2015.09.06

- change image png

- refomat code for markdown and dynamix inherent functions

###2015.08.31

- add full path to settings page POST scripts

###2015.08.27

- fix plugin remove script

###2015.08.26

- update extensions to php 5.4.44

- updated for unRAID 6.1

###2015.08.20

- fix rc.apache symlink

###2015.08.19

- update apache to 2.4.16

- update extentions to php 5.4.43

- updates for unRAID 6.1-rc* only

###2015.06.13

- fix php extensions 

###2015.06.06

- update to apache 2.4.12

- update php extensions to 5.4.40

- remove libpng and libjpeg packages will need to reboot

###2015.04.21

- fix for phpvirtualbox, phpMyAdmin

- change "short_open_tag" = On in php.ini

- add delete for log files

- fix start, stop restart needing page refresh

###2015.04.19

- added more logging

###2015.04.18

- fix bugs

- add version and link to webserver

###2015.04.17

- update extentions to php 5.4.36

- added directory browser

- reformatted layout

###2015.01.31

- update for beta12+

###2014.09.25

- fix install and remove scripts

###2014.09.25

- reformated github and plugin format

- conf files will now be in /boot/config/plugins/apache/httpd

###2014.06.07

- initial commit

 

Edited by dmacias
  • Upvote 1
Link to comment
  • 1 month later...

any chance we could get this for 5.0.5?

 

really looking for a web server for unraid without using Dynamix or SF.

 

Thanks!

I'll see what I can do.  I still have the initial version 5 plg I started before moving to 6. I'll see if I can modify the version 6 plg for 5. As I remember though I could only use it as a basic web server and proxy/redirects. Php wouldn't work because of package problems. It was a pain trying to figure out which packages would work. I don't have 5 so you'll have to be the guinea pig. :)

 

Link to comment

Out of curiosity, what does installing Apache enable you to do? I did check out the website but it looked like there could be many uses.

I don't use the plg but use apache in my Ubuntu vm. I use it for MythWeb which is a Web page front end for my mythbackend, I use phpMyAdmin to admin the mysql databases for xbmc and mythtv. Also I use the main Web page as htpc-manager and then redirect all the apps. So if I go to https://apps I get htpc-manager,  https://apps/sabnzbd I get sabnzbd no port numbers and ssl.  Also within the apps like sickrage I just use localhost, no port and /sabnzbd and /deluge if that makes sense.

Link to comment

huh that's pretty nifty... I'll have to add that to the list of "unRAID test things"

And ownCloud too. You can also use it to proxy any other Web page in your network like routers or printers.  You could also setup a reverse ssl proxy with the proper security settings and connect from anywhere, exposing only a single port. And use apps like transdrone to monitor and adds torrents.

 

Link to comment

I have done something similar with the webservers that were part of Simplefeatures and Dynamix. Create a home page with links to all of the application start pages. I even created one to headphones that used IP address instead of server name to prevent its massive cookies from interfering with browsing the rest of the server.

Link to comment

any chance we could get this for 5.0.5?

 

really looking for a web server for unraid without using Dynamix or SF.

 

Thanks!

I'll see what I can do.  I still have the initial version 5 plg I started before moving to 6. I'll see if I can modify the version 6 plg for 5. As I remember though I could only use it as a basic web server and proxy/redirects. Php wouldn't work because of package problems. It was a pain trying to figure out which packages would work. I don't have 5 so you'll have to be the guinea pig. :)

 

i'd be happy to be the test monkey!!!  i'm running 5.0.5.  i've had the SF/Dynamix web server which are both lighttpd but SF and dynamix have issues and crash once in a while.  I'd love to have the stock 5.0.5 with apache would be amazing. 

 

Thank you so much!

Link to comment
You could also setup a reverse ssl proxy with the proper security settings and connect from anywhere, exposing only a single port. And use apps like transdrone to monitor and adds torrents.
Any chance you could put together a brief howto for doing this in unraid? Or, if there is no change from doing it in unraid from a standard distro, point to someone else's generic walkthrough?
Link to comment

You could also setup a reverse ssl proxy with the proper security settings and connect from anywhere, exposing only a single port. And use apps like transdrone to monitor and adds torrents.
Any chance you could put together a brief howto for doing this in unraid? Or, if there is no change from doing it in unraid from a standard distro, point to someone else's generic walkthrough?

I added the proxy hosts to the plugin.  Just delete the file /boot/config/plugins/apache/httpd.conf and reinstall the plugin.  Then before you start apache uncomment the line at the bottom of httpd.conf to activate proxiedhosts. You can then edit  /boot/config/plugins/apache/proxiedhosts to fit your needs.

Link to comment

You could also setup a reverse ssl proxy with the proper security settings and connect from anywhere, exposing only a single port. And use apps like transdrone to monitor and adds torrents.
Any chance you could put together a brief howto for doing this in unraid? Or, if there is no change from doing it in unraid from a standard distro, point to someone else's generic walkthrough?

I added the proxy hosts to the plugin.  Just delete the file /boot/config/plugins/apache/httpd.conf and reinstall the plugin.  Then before you start apache uncomment the line at the bottom of httpd.conf to activate proxiedhosts. You can then edit  /boot/config/plugins/apache/proxiedhosts to fit your needs.

Reinstalling the plugin does not recreate httpd.conf. I assume when you say reinstall, you mean run installplg against apache_64.plg?
Link to comment

In order to reinstall the plugin, I had to edit the plg file to update a broken file reference.

 

Here is what I replaced it with, and it allowed a reinstall. I haven't started it yet to see if I broke something else by doing this.

<FILE Name="/boot/packages/httpd-2.4.10-x86_64-2_slack14.1.txz" Run="upgradepkg --install-new">
<URL>http://ftp.slackware.com/pub/slackware/slackware64-14.1/patches/packages/httpd-2.4.10-x86_64-1_slack14.1.txz</URL>
<MD5>efc9893a3428d87a8d78787fbde793e0</MD5>

 

I started it, and the basic webserver part appears to be working, my phpVirtualbox is up.

Link to comment

I got the reverse proxy set up for Sab, Sick, Couch, and Transmission. I couldn't get it to work for maraschino, but that's really no big deal, I just recently starting playing with maraschino.

 

Now, I started playing around with authentication and SSL so I could expose it to the intarwebs without using my vpn, but it looks like I would need to rewrite some of the plugin to get that functionality to survive a reboot.

 

Is there any chance that you (dmacias) were planning on doing ssl and password authentication in the future?

Link to comment

I got the reverse proxy set up for Sab, Sick, Couch, and Transmission. I couldn't get it to work for maraschino, but that's really no big deal, I just recently starting playing with maraschino.

 

Now, I started playing around with authentication and SSL so I could expose it to the intarwebs without using my vpn, but it looks like I would need to rewrite some of the plugin to get that functionality to survive a reboot.

 

Is there any chance that you (dmacias) were planning on doing ssl and password authentication in the future?

Ok I added SSL and included a script /boot/config/plugins/apache/cert.sh to create your server.crt if you need. You'll need to rename your /boot/config/plugins/apache/http.conf and installplg again then uncomment "Include /boot/config/plugins/apache/httpd-ssl.conf" in httpd.conf and proxyhosts again if your using that.  It won't start if you don't have a server.crt in /boot/config/plugins/apache. Added instructions to first post.

Link to comment

Got the ssl part running fine, thanks.

 

Now, I seem to be missing something obvious, I tried adding this

<Directory "/mnt/cache/Applications/www/html">
AuthType Basic
AuthName "Username and Password Required"
AuthUserFile /boot/config/plugins/apache/.htpasswd
Require valid-user
</Directory>

to httpd.conf and / or httpd-ssl.conf but it doesn't ask for a login. Yes, I generated a .htpasswd file and put it in the apache folder.

Link to comment

Tried a different tack, it seems to work so far.

 

I uncommented the mod_rewrite and set AllowOverride to AuthConfig in the directory section of httpd.conf, and now it uses the .htaccess file in the root of my web directory with this

AuthType Basic
AuthName "Username and Password Required"
AuthUserFile /boot/config/plugins/apache/.htpasswd
Require valid-user

content to ask for a password, both on the standard and ssl side.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.