Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

STunnel question

Featured Replies

I've been playing with the Uniform Server, and it's working great so far. I do have a question, though. Is there a method for automatically starting STunnel when the server starts? I'd like to have it start up right away without having to go to the "plugins/Stunnel-4.05/index.html" page and clicking on the cgi link.

  • Author

I'd hoped there was an easy way. :) But, after some playing with the batch files, I've gotten it to work by modifying the Server_Start.bat file. I've also re-arranged it a bit, mainly to make it easier for me to tell what I was doing. I also added a line to the Close.bat file to shut down STunnel when the server shuts down. I'll post them here in case anyone is interested.

 

new_server_start.bat

: Batch file to start the Uniform Server with STunnel
: Author: packrat
: Based on 'Server_Start.bat' by The Uniform Server Development Team

@echo off

rem use: start <driveletter> mysql console - to start mysql at server start and display console
rem use: start <driveletter> mysql - to start mysql at server start
rem use: start <driveletter> nomysql console - to display console

rem Check to see if Apache is already started
diskw\home\admin\program\pskill Apache.exe
IF NOT ERRORLEVEL 1 goto started

rem Create the virtual drive
set Disk=%1
IF "%Disk%"=="" set Disk=w
subst %Disk%: "diskw"
IF ERRORLEVEL 1 goto hint

rem Set some useful variables
set apachepath=\usr\local\apache2\
set apachecommand=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d %apachepath%.
set programpath=%Disk%:\home\admin\program\
set closecommand=%programpath%close.bat %Disk%
set www=\www\
set apanel=\home\admin\www\

rem Uncomment this line if you're using STunnel
set stunnelpath=%Disk%:\home\admin\Www\plugins\Stunnel-4.05\bin\

%Disk%:
cd \usr\local\php
IF "%2"=="mysql" goto mysql
:startserver
rem Uncomment this line if you're using STunnel
start %stunnelpath%stunnel-4.05 %stunnelpath%ssltunel.conf
echo The server is working on the disk %Disk%:\ [http/127.0.0.1/apanel/]
start %Disk%:%apanel%redirect.html
if "%3"=="console" goto console
start %programpath%uniserv.exe "%apachecommand%" "%closecommand%"
goto end

:started
echo Error: Apache is already started. Use 'Stop.bat'
goto end

:hint
echo The drive letter %Disk% is already in use. Use 'Disk Start.vbs' [driveletter]
goto end

:console
%apachecommand%
%closecommand%
goto end

:mysql
rem %Disk%:
rem cd \usr\local\php
start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf
goto startserver

:end

 

Close.bat

@echo off
set Disk=%1
IF "%Disk%"=="" set Disk=w
%Disk%:\home\admin\program\pskill.exe mysqld-opt.exe
IF ERRORLEVEL 1 goto nomysql
%Disk%:\usr\local\mysql\bin\mysqladmin.exe --character-sets-dir="/usr/local/mysql/share/charsets/" --user=root --password=root shutdown
:nomysql
rem Shut down STunnel if it's running
%Disk%:\home\admin\program\pskill.exe stunnel-4.05.exe c
subst %Disk%: /D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.