Permanence of Additional >8 Virtual Sites After Reboot

Web hosting, MySQL, PHP and all that good stuff.

Moderator: Lillian.W@AST

Post Reply
ArtM
Posts: 17
youtube meble na wymiar Warszawa
Joined: Mon Aug 11, 2014 5:40 pm

Permanence of Additional >8 Virtual Sites After Reboot

Post by ArtM »

If I add more virtual sites on my 604T NAS beyond the built-in maximum of 8 (ASUSTOR Pls expand !);
will they remain after a reboot ? After a Reset ? If not, how do I backup & reload the additional definitions ?
crazynas
Posts: 222
Joined: Mon Feb 16, 2015 10:34 pm

Re: Permanence of Additional >8 Virtual Sites After Reboot

Post by crazynas »

Hi
This is limition on AS-6. If your want add more virtual sites, I suggestion you buy more NAS. first will got good performance on your website.
MikeG.6.5
Posts: 917
Joined: Fri May 15, 2015 1:56 am

Re: Permanence of Additional >8 Virtual Sites After Reboot

Post by MikeG.6.5 »

There is likely a hard coded limit to the number of sites that can be addressed within the ADM's interface. That's something Asustor would need to change within the ADM itself, but I think we might be able to get around if you can start the additional web sites through a shell session.

I have a script that uses curl to test if Plex is running on my NAS. This script hits the NAS on either the localhost or on the DDNS name on the port I have open for Plex. If a value is returned nothing happens. If a value is NOT returned then it stops Plex from running, waits 5 seconds and then start Plex back up. Here is a sample of the script:

Code: Select all

#!/bin/sh
#######################################################################################
#  This script tests to make sure the Plex Media Server application is running on     #
#  your Asustor NAS.  If it is the script exits and does nothing.  If not it will     #
#  stop Plex Media Server to clear any residual porcesses and then start Plex Media   #
#  Server.                                                                            #
#  ---------------------------------------------------------------------------------  #
#  You can change this to test for remote access by changing the localhost to the     #
#  DNS name of your NAS.  Ex: If you use Asustor's DDNS service it would be something #
#  like http://yourddnsname.myasustor.com:  If you ,apped Plex Media Server to        #
#  another port other than than 32400 you will need to edit the script below to       #
#  that port number.                                                                  #
#  ---------------------------------------------------------------------------------  #
#  This can be used to test operation of any app that has a web page for accessing    #
#  the app itself.  If the app is a stand alone app and doesn't use a web page        #
#  this check will not work.  There are other ways to check their operations.         #
#  ---------------------------------------------------------------------------------  #
#  Visit http://forum.asustor.com/index.php and ask MikeG.6.5 for any support issues  #
#######################################################################################


curl -I -m 8 "http://localhost:32400/web/index.html"
if [ "$?" -ne "0" ]

then
/usr/sbin/syslog --log 0 --level 0 --user admin --event "Remote Access to Plex is unavailable"

                /usr/local/AppCentral/plexmediaserver/CONTROL/start-stop.sh stop
                sleep 5
                /usr/local/AppCentral/plexmediaserver/CONTROL/start-stop.sh start
fi

exit 0
Obviously you are going to need to change the port number, and the page that you are testing. And obviously you are going to want to insert your shell commands in the place of the start-stop.sh commands given in the sample. But this should do what you are wanting to do. You can make up several of these small test scripts, one for each of the web sites you plan to host, and then another script that calls each of these scripts in turn. The last script is then called in the cron file located at: /volume0/usr/builtin/etc/crontabs/root Here is a sample of the root I use for my NAS:

Code: Select all

##############################################################################################
#  This is the cron file and is used to tell the NAS to do things within certain time frames #
#  or specific times of the day.  It has a very specific syntax of how to do the timing.     #
#  Refer to the chart below for examples of what the timings are. This file is located at    #
#  /volume0/usr/builtin/etc/crontabs/root.  You will need WinSCP or another shell client     #
#  to access or edit this file.                                                              #
#  ----------------------------------------------------------------------------------------  #
#  Example:   */20 * * * * command every 20 minutes starting on the hour execute the         #
#  command.  0 0 * * * command means execute the command at midnight.                        #
##############################################################################################
# .---------------- minute (0 - 59)                                                          #
# |  .------------- hour (0 - 23)                                                            #
# |  |  .---------- day of month (1 - 31)                                                    #
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...                                    #
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat       #
# |  |  |  |  |                                                                              #
# *  *  *  *  * user-name  command to be executed                                            #
##############################################################################################
*/15 * * * * /volume1/misc/CkApps.sh
*/20 * * * * /volume1/misc/Movies-Convert/movie-convert.sh
0 0 * * 1,2,3,4,5,6,7 /usr/builtin/sbin/nightmodectrl on
0 5 * * 1,2,3,4,5,6,7 /usr/builtin/sbin/nightmodectrl off
30 0 * * * /bin/sh /usr/builtin/sbin/ntpupdate.sh north-america.pool.ntp.org 
The CkApps.sh is the script that checks if the web apps I want to verify operations of are running. It's called every 15 minutes to test their operation. The @bootup command does NOT work with Asustor's implementation of cron, so there's no need for you to try it. I had a ticket opened for this, and there was little response trying to get it resolved.

I hope this gives you an idea of how you can test and then start a web service using the tools we have with Asustor's implementation of Linux. BTW, in case you didn't know, your NAS is running a modified version of something called BusyBox. A kind of lobotomized flavor of Ubuntu. It's typical of NASes, routers and other smaller Linux devices, giving most, but not all Linux commands at the shell.

HTH
Post Reply

Return to “Web Hosting”