https://wiki.uniformserver.com/api.php?action=feedcontributions&user=Upazixorys&feedformat=atomThe Uniform Server Wiki - User contributions [en]2024-03-29T08:30:56ZUser contributionsMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=Z_controller_Help&diff=4909Z controller Help2010-11-24T11:27:15Z<p>Upazixorys: </p>
<hr />
<div>=[http://uwujojedeh.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Nav z controller}}<br />
'''Help menu introduction'''<br />
<br />
This menu provides Uniform Server web sites short cuts to Main Site, Forum and Wiki.<br />
<br />
It includes an overview of Z-Controlller and an about box that displays WinBinder and PHP version.<br />
<br />
The first menu item you may find useful it opens a window reporting server status. <br />
{|cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''''Menu Item'''''||'''''Description'''''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|<br />
* Server Status<br />
|<br />
Opens a window reporting server status including current port settings service names server running mode and connectivity.<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|<br />
* Web site<br />
* Forum site<br />
* Wiki site<br />
|<br />
Menu items providing short cuts to Uniform Server’s web sites.<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|<br />
* Z-Controller Overview<br />
|<br />
Provides a quick guide to Z-Controller<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|<br />
* About<br />
|<br />
A standard about box also provides version details.<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Server Status ==<br />
The following screen shots displays the current status of two Server configuration.<br />
<br />
First is a default Uniform Server installation, which is connected to the Internet with router port 80 forwarded.<br />
<br />
Second is for comparison it shows [[Z controller Local#Move servers | '''Uniform Server moved''']] once and not connected to the Internet.<br />
<br />
''Note'': This script checks the first two items directly from the Internet hence takes a relatively long time to run. <br />
{|<br />
|- valign=&quot;top&quot;<br />
|<br />
'''''Your Internet IP Address'''''<br />
<br />
This is your unique IP address as assigned by your service provider. If this is static it will not change. A dynamic IP will change every time you reconnect to the Internet.<br />
<br />
'''''Accessible from Internet'''''<br />
<br />
The above IP address is used to check if your server is accessible from the Internet. It uses a single page in its own root folder for this test. If “Yes” displayed putting your root folders (www and or ssl) on-line Internet users can view your server.<br />
<br />
If test displays “No” you probably are behind a router and the ports need to be forward to your PC.<br />
<br />
'''''Apache Server'''''<br />
<br />
Displays current server port settings taken from configuration files.<br />
Server executable and service name are also listed.<br />
Server runs status displays either running or not running.<br />
Server installed status this can be either not installed or installed as a standard program or service.<br />
<br />
'''''MySQL Server'''''<br />
<br />
Displays current server port setting taken from configuration file.<br />
Server executable and service name are also listed.<br />
Server runs status displays either running or not running.<br />
Server installed status this can be either not installed or installed as a standard program or service.<br />
<br />
'''''Port Status'''''<br />
<br />
This section is important. If the ports are in use by another server this server will not run. If ports are free to use you can run this server. This server is running port status displays port in use by this server.<br />
<br />
|<br />
[[Image:Server_status_2.gif]]<br />
|- valign=&quot;top&quot;<br />
|<br />
=== Comparison ===<br />
Server moved to different ports:<br />
<br />
'''''Apache Server'''''<br />
<br />
Moving Uniform Server increments server ports.<br />
Server executable and service name are also incremented.<br />
Server runs status displays either running or not running.<br />
Server installed status this can be either not installed or installed as a standard program or service.<br />
<br />
'''''MySQL Server'''''<br />
<br />
Moving Uniform Server increments server port.<br />
Server executable and service name are also incremented.<br />
Server runs status displays either running or not running.<br />
Server installed status this can be either not installed or installed as a standard program or service.<br />
<br />
'''''Port Status'''''<br />
<br />
This section is important. If the ports are in use by another server this server will not run. If ports are free to use you can run this server. This server is running port status displays port in use by this server.<br />
|<br />
[[Image:Server_status.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
That concludes our tour of Z-Controller. Its functionality is not written in stone if you don’t like something hack the code to suit your own requirements.<br />
<br />
Z-Controller loosely integrates into Uniform Servers control architecture what this means if you don’t like it just delete folder zcon and all its content this completely removes it.<br />
<br />
Even if you do not use the controller you may find the code snippets of use.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=DtDNS:_PHP_cURL_1&diff=4907DtDNS: PHP cURL 12010-11-24T11:01:33Z<p>Upazixorys: </p>
<hr />
<div>=[http://egyworene.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Nav DtDNS}}<br />
'''''Introduction'''''<br />
<br />
On the previous page I explained why you should never enable external includes in php.ini there is a safer way to download external pages and that is to use cURL.<br />
<br />
Uniform Server 5.0-Nano has cURL enabled by default hence you can start using it straightaway. This page looks at extracting your current IP address from one of the pages downloaded see previous page for page links.<br />
<br />
== Example Code ==<br />
This script is based on a template taken from the cURL tutorial found on [[PHP cURL: Basics#Example 4 - Download and save page to a variable | '''this page''']]. <br />
<br />
Page downloaded is captured as a text string and saved in variable $buffer. This isolates any potenial harfull code.<br />
<br />
Extracting the IP address is performed using a regex since we are specifically targeting information we want and discarding any other page content means any harmful code will never be run.<br />
{|cellspacing=&quot;6&quot;<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$ch=curl_init();<br />
curl_setopt($ch,CURLOPT_URL,'http://myip.dtdns.com');<br />
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);<br />
$buffer = curl_exec($ch);<br />
curl_close($ch);<br />
<br />
if (empty($buffer)){<br />
// Need to add code and recover from this<br />
}<br />
<br />
else{<br />
// Extract IP address <br />
if(preg_match(&quot;/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/&quot;, $buffer, $ipmatch)){ <br />
$ip = $ipmatch[0]; // Save IP to variable<br />
}<br />
}<br />
print $ip; // Test code <br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
* Initialize Curl and save memory location in variable $ch<br />
* Set the Curl URL option to the URL we wish to work with <br />
* Set the Curl TIMEOUT option to 10 Seconds. If page fails to load give-up after 10 seconds <br />
* Set RETURNTRANSFER to 1. This forces the output of curl_exec() to be a string and not to reserve page.<br />
* Run Curl curl_exec(), downloads page from external server converts it to a string which is saved in variable $buffer<br />
* Close Curl<br />
* Check buffer empty will need to do something in the final script if empty<br />
* Its not empty use preg_match to extract matched pattern, save in array $ipmatch<br />
* Save first element to variable $ip<br />
* Print to confirm.<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Test 1 - Server ===<br />
The script will run on a server, perform the following test:<br />
* Create a new folder C:\'''dtdns_test'''<br />
* Extract a copy of 5-Nano to this folder.<br />
* Create a new text file in folder C:\dtdns_test\UniServer\'''www''' and name it '''dtdns_test_1.php''' add the following content<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$ch=curl_init();<br />
curl_setopt($ch,CURLOPT_URL,'http://myip.dtdns.com');<br />
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);<br />
$buffer = curl_exec($ch);<br />
curl_close($ch);<br />
<br />
if (empty($buffer)){<br />
// Need to add code and recover from this<br />
}<br />
<br />
else{<br />
// Extract IP address <br />
if(preg_match(&quot;/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/&quot;, $buffer, $ipmatch)){ <br />
$ip = $ipmatch[0]; // Save IP to variable<br />
}<br />
}<br />
print $ip; // Test code <br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
'''''Run Test 1'':'''<br />
* Run servers<br />
* Type '''&lt;nowiki&gt;http:&lt;/nowiki&gt;//localhost/dtdns_test_1.php''' into your browser<br />
* Result: Returns your '''current'''IP address for example <br />
&lt;pre&gt;<br />
179.79.934.216<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Test 2 - PHP CLI ===<br />
We require the script to run in PHP cli mode.<br />
* Create a new folder C:\dtdns_test\UniServer\plugins\'''dtdns_updater'''<br />
* Copy file C:\dtdns_test\UniServer\www\'''dtdns_test_1.php''' to the above folder.<br />
* Inside folder '''dtdns_updater''' create a new text file '''Run_dtdns_test_1.bat''' with the folowing content:<br />
'''Run_dtdns_test_1.bat'''<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
rem ### working directory current folder <br />
pushd %~dp0<br />
<br />
..\..\usr\local\php\php.exe dtdns_test_1.php<br />
<br />
rem ### restore original working directory<br />
pause<br />
popd<br />
EXIT<br />
&lt;/pre&gt;<br />
|<br />
'''''Run Test 2'':'''<br />
* Close servers<br />
* Double click on Run_dtdns_test_1.bat<br />
* Result: Returns your '''current''' IP address for example <br />
&lt;pre&gt;<br />
179.79.934.216Press any key to continue . . .<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
I have shown how easy Curl is to use and how to obtain your '''current''' IP address. The code can be used in either server or CLI mode.<br />
<br />
Its only part of a solution we need to access DtDNS update page by providing an ID and password over a secure connection. Again Curl makes this easy see [[DtDNS: PHP cURL 2 | '''next page''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Oily_Rag_1:_CD_Part_3&diff=4905Oily Rag 1: CD Part 32010-11-24T10:46:49Z<p>Upazixorys: </p>
<hr />
<div>=[http://abaviteha.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc nav oily rag 1 CD}}<br />
'''Uniform Server running from a CD - Part 3'''<br />
<br />
My sole intention of Parts 1 and 2 was to show how easy it is to run Uniform Server from a CD. The method I used was to redirect any functions requiring read/write access to a folder located on C drive. A problem arises when you want to use a different drive or folder name, every file modified requires changing to that new path. It's not a major problem all you need to do is perform a global search and replace, none the less a minor irritation.<br />
<br />
'''Mode switching problems'''<br />
<br />
I introduced the concept of mode switching allowing Uniform Server to be run in either of two modes. Although it works it is '''sadly flawed''', not the concept (makes it user-friendlier) but the implementation. Using fixed file substitution (swapping) does not cater for any new changes made to working files. These changes are not reflected in either of the switching mode files. Selecting a mode will destroy any changes because files are overwritten.<br />
<br />
In Part 1 I avoided this issue with this statement “an alternative to hard coding is to use search and replace however that's just added complexity keep it simple is my motto” neat trick because I was looking for a batch file solution knowing full well search and replace is extremely difficult using batch files.<br />
<br />
'''Path to a real plugin'''<br />
<br />
To produce a real plugin this article addresses the above issues. It uses a mix of batch files and Perl scripts. I don’t know why Perl has a reputation for being difficult to use but it does and was my prime reason for not using it in the previous article. Perl like any other scripting language can be as simple or as complex as you like to make it. I hope at the end of this tutorial you will view Perl in a new light, it really is a powerful friend.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Starting point ==<br />
We already know which files to target and the lines that need modification. This solution leaves original files in place thus avoiding the swapping problem. Files remain in situ and are changed directly using Perl. This has the advantage any changes made using apanel (us-mode) will now be captured when burning a CD. <br />
<br />
This dynamic mode switching has one more advantage; we can offer a user an option of selecting a different location (drive and folder) for the temporary folder or use a default folder.<br />
<br />
'''Path to a real plugin'''<br />
== Perl Commands ==<br />
Before looking at any scripts I cover the Perl commands used. In many ways and because of its origin Perl is nothing more than a glorified command processor, admittedly a very powerful one. I find interactive input-output always poses a problem hence cover this first. The following four commands are more than adequate for most scripts.<br />
<br />
{|cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;background:#444444&quot;<br />
|-style=&quot;background:#d7d7d7&quot;<br />
!Instrustion<br />
!Perl Input and Output<br />
|-valign=&quot;top&quot; style=&quot;background:#e6e6e6&quot;<br />
|width=&quot;150&quot;|<br />
'''system( )'''&lt;br&gt;<br />
system( 'cls' )&lt;br&gt;<br />
system( 'pause' )<br />
|<br />
'''''system()'':''' is a function that will execute any command you would normally type at a command prompt. Enclose the command between quotes.<br />
<br />
''''''cls''':''' Clears the command prompt screen.&lt;br&gt;<br />
''''pause':''' This halts a script and prompts a user with the message '''Press any key to continue....'''<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|'''print''' &quot;Some text\n&quot;;<br />
|Prints whatever is between the two quotes, \n start on a new line.<br />
|- style=&quot;background:#e6e6e6&quot;<br />
|<br />
'''&lt;STDIN&gt;'''<br />
<br />
my $input = &lt;STDIN&gt;;<br />
|<br />
When &lt;STDIN&gt; is executed it gets characters from the keyboard and stops when the enter key is pressed. The enter key itself is included as a character.&lt;br&gt;<br />
To capture an input from &lt;STDIN&gt; you assign it to a variable as shown '''$input'''&lt;br&gt;<br />
'''my''' is not required for scripts run directly however when initiated from a batch file '''my''' forces the variable to be local to the script. Hence '''my''' is required to capture a variable, otherwise the script swans off.<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|<br />
'''chomp''' $input;<br />
|In most situations you do not want that enter key character (mentioned above) hence chomp removes it giving you a clean string.<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#e6e6e6&quot;|&amp;nbsp;<br />
|style=&quot;background:#d2ffc6&quot;|The above looks confusing lets look at a real example. I want a variable that contains only the characters for a person’s name, the variable is '''$some_name'''&lt;br&gt;<br />
<br />
'''my $some_name = &lt;STDIN&gt;;'''&lt;br&gt;<br />
'''chomp $some_name;'''<br />
<br />
Just two lines of neat code <br />
|}<br />
<br />
Using the above commands you can provide some neat dialogue between users and scripts. No fancy Windows things, just a simple text interface using the command prompt window.<br />
<br />
Other commands used, these hide dirty tricks that go on behind the scenes!Well thought I would make it sound dramatic.<br />
<br />
'''''Note'':''' For portability I use only core Perl commands. <br />
<br />
{|cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;background:#444444&quot;<br />
|-style=&quot;background:#d7d7d7&quot;<br />
!Instrustion<br />
!Perl Input and Output<br />
|-valign=&quot;top&quot; style=&quot;background:#e6e6e6&quot;<br />
|width=&quot;250&quot;|<br />
'''open(INFILE,$file);'''&lt;br&gt;<br />
'''@some_name=&lt;INFILE&gt;;'''&lt;br&gt;<br />
'''close(INFILE);''' <br />
|<br />
These commands read the content of a text file into an array.<br />
<br />
'''$file''' is a variable containing the complete path to the file including its name.<br />
<br />
'''open()''' is the function that opens a file, '''INFILE''' is referred to as an handle you can name it whatever you like so long as it is unique. It contains information about the file that Perl can use latter.<br />
<br />
'''@some_name''' @ creates an array who's name is some_name you can use whatever you like for some_name so long as it is unique.<br />
<br />
='''&lt;INFILE&gt;''' get every line that is associated with handle INFILE and put it into the array some_name.<br />
<br />
'''close(INFILE)''' Just closes the file associated with handle INFILE and '''cleans up'''.<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|<br />
'''open(OUTFILE,&quot;&gt;$file&quot;);'''&lt;br&gt;<br />
'''&amp;nbsp;foreach $save(@some_name){'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;print OUTFILE $save;'''&lt;br&gt;<br />
'''}'''&lt;br&gt;<br />
'''close(OUTFILE);'''<br />
|<br />
These commands write the content of an array line by line into a text file.<br />
<br />
'''$file''' is a variable containing the complete path to the file including its name.<br />
<br />
'''open()''' is the function that opens a file, '''OUTFILE''' is referred to as an handle you can name it whatever you like so long as it is unique. It contains information about the file that Perl can use latter. The &gt; means that the file is open for writing. Note: When a file is open for writing its contents are destroyed.<br />
<br />
'''foreach $save(@some_name)''' foreach @some_name scans the array @some_name line by line after reaching the last line continues on to the next command. Every time a line is scanned it is read from the array and placed into the variable $save overwriting its previous content.<br />
<br />
'''print OUTFILE $save''' This line is placed within the foreach loop. It prints (copies) the content of variable $save to the file associated with handle OUTFILE. Hence every line in the array is written to the file.<br />
|- style=&quot;background:#e6e6e6&quot;<br />
|<br />
'''if($new_drive eq &quot;&quot;){'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;$new_drive = $temp_drive;'''&lt;br&gt;<br />
'''}''' <br />
|<br />
If the condition within the brackets is true execute the commands within the curly braces otherwise continue.<br />
<br />
In this example the variable $new_drive is checked to see it it is '''eq'''ual to the string in the quotes. If it is true then a drive letter has not been set to give it a value the $temp_drive is assigned to it.<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|<br />
'''@mpg=();'''<br />
|<br />
The quickest way to clear an array is to assign nothing to it. No content in the brackets.<br />
|- style=&quot;background:#e6e6e6&quot;<br />
|<br />
'''push(@mpg,&quot;data&quot;);'''<br />
|<br />
There are several ways to assign data to an array. Push is a function that takes two parameters, the first is the array to work on @mpg followed by the data to store. Data is stored in the next available location, arrays automatically expand to accommodate the data.<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|<br />
'''$str1 = pop(@mpg);'''<br />
|<br />
Pop is the reverse of push, it extracts one line from the array and can be assigned to a variable. The array automatically contracts once the data has been removed (popped)<br />
<br />
'''''Note'':''' The data popped is the last one that was pushed into the array. Last in first out.<br />
|- style=&quot;background:#e6e6e6&quot;<br />
|<br />
'''@mpg=reverse(@mpg);'''<br />
|<br />
The reverse function when applied to an array reveres the order of its content. It makes a temporary copy hence the reason to assigning it to itself. If you apply this command before popping data you now get what was first pushed into the array.<br />
|-valign=&quot;top&quot; style=&quot;background:#d7d7d7&quot;<br />
|<br />
'''sub update_files {'''<br />
<br />
'''}'''<br />
|<br />
'''Sub''' (functions) are pieces of reusable code that you place inside the curly braces. Each sub must have a unique name for example update_files with no brackets after the name.<br />
<br />
To call a sub from your main code add bracketes to the name for example '''update_files()'''<br />
<br />
Passing parameters to a sub use a comma seperated list fred('''10,20,30''');<br />
<br />
These values get passed as an array named '''@_''' you access these values using '''$_[0]''' etc these variable contain the following values:<br />
<br />
$_[0]=10&lt;br&gt;<br />
$_[1]=20&lt;br&gt;<br />
$_[2]=30<br />
<br />
You can pass arrays for example fred(10,20,@mpg) these get passed to the array @_ what I find a pain, arrays gets flattened. To access values within your sub, now looks like this:<br />
<br />
$_[0]=10&lt;br&gt;<br />
$_[1]=20&lt;br&gt;<br />
$_[2]=$mpg[0]&lt;br&gt;<br />
$_[3]=$mpg[1]&lt;br&gt;<br />
$_[4]=$mpg[2]<br />
|}<br />
<br />
== Summary ==<br />
Real reason for listing the above commands apart from making my scripts easier to read you now know what to search for on the Internet. There are some great tutorials out there that are worth reading.<br />
<br />
Time to look at [[Oily Rag 1: CD Part 4|USCD2]] plugin.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Oily Rag]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=SlimFTPd:_Config_File&diff=4903SlimFTPd: Config File2010-11-24T10:32:24Z<p>Upazixorys: </p>
<hr />
<div>=[http://ecacoraqosy.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
SlimFTPd: <br />
[[SlimFTPd: Home | Home]] | <br />
[[SlimFTPd: Tutorial | Tutorial]] | <br />
[[SlimFTPd: Clients | Clients]] | <br />
[[SlimFTPd: Config File | Config File]] | <br />
[[SlimFTPd: Config Anonymous | Config Anonymous]] | <br />
[[SlimFTPd: Plugins | Plugins]] | <br />
<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''SlimFTPd Configuration file - Details'''<br />
|}<br />
Configuration file - Detail<br />
<br />
In the configuration file you will find one piece of archaic terminology the term '''MOUNT'''. Today it stands for connect to either a hard drive or file system or even some other media. In the dark ages it meant phone up an administrator and ask for a tape to be taken to the tape reader and that person would MOUNT the tape into a machine. A bit slow by today's standards but then programming was done using hand punches and card readers.<br />
<br />
'''SlimFTPd Configuration file - Detail'''<br />
<br />
Do not be deceived by the simplicity or lack of configuration commands the few there are is more than enough to give FTP access to any file on your computer.<br />
<br />
== Global server variables ==<br />
Your configuration file ('''''slimftpd.conf''''') must contain these six commands, in most cases the default values are adequate.<br />
<br />
{|style=&quot;background:#666666&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| BindInterface<br />
|valign=&quot;top&quot;| All<br />
| Which network interface should be used to listen for incoming connections.&lt;br&gt;Available options are All, '''LAN''', '''WAN''', '''Local''', or you can specify an IP address.<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| BindPort<br />
|valign=&quot;top&quot;| 21<br />
| The BindPort directive specifies which TCP port should be used to listen for incoming connections.&lt;br&gt;The standard FTP port is '''21'''.<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| CommandTimeout<br />
|valign=&quot;top&quot;| 300<br />
| The CommandTimeout directive specifies how many seconds to wait for a connected client to issue a command before dropping the connection.&lt;br&gt;Default is 300 (5 minutes).<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| ConnectTimeout<br />
|valign=&quot;top&quot;| 15<br />
|The ConnectTimeout directive specifies how many seconds to wait for a data socket to connect with a client. This value applies to both active-mode and passive-mode connections.&lt;br&gt; Default is 15.<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| MaxConnections<br />
|valign=&quot;top&quot;| 20<br />
| The MaxConnections directive specifies an upper limit on the number of connections that may be made to the server at any one time.&lt;br&gt; Default is 20.<br />
|-style=&quot;background:#eeeeee&quot;<br />
|valign=&quot;top&quot;| LookupHosts<br />
|valign=&quot;top&quot;| on<br />
|The LookupHosts directive tells SlimFTPd whether it should look up the corresponding host names for IP addresses when logging connections. Note that this may take slightly more network bandwidth and may cause a short delay for users during initial connection.&lt;br&gt; Default is On.<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== User accounts ==<br />
Below the global server variables you add user profiles. Each user profile is constructed from the following tags (commands/directives).<br />
<br />
{|style=&quot;background:#666666&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-<br />
|style=&quot;background:#eeeeee&quot; valign=&quot;top&quot;| '''&lt;nowiki&gt;&lt;User &quot;name&quot;&gt;&lt;/nowiki&gt;'''<br />
|style=&quot;background:#ffffff&quot; valign=&quot;top&quot;| Opening tag for user profile. Name of user do not use spaces or any special characters&lt;br&gt;<br />
(A name &quot;'''anonymous'''&quot; used with password set to '''&quot;&quot;''', allows anyone access no authentication required.)<br />
|-<br />
|style=&quot;background:#eeeeee&quot; valign=&quot;top&quot;| '''&lt;nowiki&gt;&lt;/User&gt;&lt;/nowiki&gt;'''<br />
|style=&quot;background:#ffffff&quot; valign=&quot;top&quot;| Closing tag for user profile<br />
|-<br />
|style=&quot;background:#eeeeee&quot; valign=&quot;top&quot;| '''Password &quot;value&quot;'''<br />
|style=&quot;background:#ffffff&quot; valign=&quot;top&quot;| Use the Password directive to set a password for a user. If no password is set, the user will be allowed to login without a password, however a user name is still required unless that has been set to '''anonymous''' see above ).<br />
|-<br />
|style=&quot;background:#eeeeee&quot; valign=&quot;top&quot;| '''Mount&amp;nbsp;[virtual&amp;nbsp;file&amp;nbsp;path][local&amp;nbsp;file&amp;nbsp;path]'''<br />
|style=&quot;background:#ffffff&quot; valign=&quot;top&quot;| Use the Mount directive to attach a local file system path to a virtual file system path.<br />
|-<br />
|style=&quot;background:#eeeeee&quot; valign=&quot;top&quot;| '''Allow'''&lt;br&gt;'''Deny'''<br />
|style=&quot;background:#ffffff&quot; valign=&quot;top&quot;| Allow and Deny directives to set permissions on paths in the virtual file system. Valid permission tokens are '''Read''',''' Write''', '''List''', '''Admin''', or '''All''' to indicate all four permission types.<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Basics ==<br />
Every access to your FTP server is controlled by user accounts (profiles) these have the following format:<br />
<br />
&lt;pre&gt;<br />
&lt;User &quot;[name]&quot;&gt;<br />
Password &quot;[password]&quot;<br />
Mount [public virtual path] [internal local path]<br />
Allow [public virtual path] [permissions]<br />
Deny [public virtual path] [permissions]<br />
&lt;/User&gt;<br />
&lt;/pre&gt;<br />
<br />
User name and password are obvious and need no explanation however '''Mount''' '''''is all-important''''' and you need to understand how it works.<br />
<br />
Using either a browser or client to view your FTP site is not quite what it appears to be, what is visible is not the real file system but a virtual one. <br />
<br />
You are looking at the '''FTP root folder''' this appears to be a real representation however in reality it is just a '''mapping''' to your '''real folders''' and '''files'''. Any permission you set in a user profile acts only on the FTP root folder.<br />
<br />
If that sounds confusing look at it another way, when you create a user profile you are building a virtual window know as the FTP root folder. Inside this folder you create sub-folders with names that you want a user to see, these may be the same as the real folders on your system.<br />
<br />
* '''Mount''' has the following elements:<br />
* ['''public virtual path'''] What you want a user to see.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;and<br />
* ['''internal local path'''] The real location on your system.<br />
<br />
<br />
You set permissions of '''Allow''' and '''Deny''' on the ['''''public virtual path'''''] element contained within the FTP root.<br />
<br />
With this knowledge lets re-visit the user profile from the previous page<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|<br />
# User name is “'''ric'''”<br />
# Password is “'''unicenter'''”<br />
# Mount “'''/'''” refers to the FTP root folder in this example no subfolder is defined<br />
# '''Mount / C:/uc_slimftpd_tutorial''' means take every thing contained in folder '''uc_slimftpd_tutorial''' on disk C: and display it in the FTP root folder.<br />
#The user is allowed full access to '''all''' the '''folders''' and '''files''' as displayed in the '''FTP root folder'''.<br />
|<br />
'''&lt;User &quot;ric&quot;&gt;'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Password &quot;unicenter&quot;'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;C:/uc_slimftpd_tutorial'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Allow / All'''&lt;br&gt;<br />
'''&lt;/User&gt;'''<br />
|}<br />
<br />
<br />
Well that was painful from here on it gets easier I will provide a few more examples leaving the anonymous user until later. Not that it is difficult but because it conflicts with simple browser testing. The truth is I am lazy it saves typing [[SlimFTPd: Config Anonymous#Email like address | email like addresses]] into the browser address bar.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== General note on testing ==<br />
After making configuration file changes '''stop''' (uc_kill_process.bat) and '''restart''' (SlimFTPd.exe) your FTP server for the changes to take place.<br />
<br />
After each example restart your browser, this will ensure you are challenged for a name and password. You can use a client for testing or use a browser however remember to type the following when using a browser '''&lt;nowiki&gt;ftp://localhost&lt;/nowiki&gt;'''<br />
<br />
'''''[[#top | Top]]'''''<br />
== Multi User Hosting ==<br />
I have two friends that are very trustworthy, they would like to upload and download files to their folders hosted on the FTP server. Open the configuration file and add a suitable block for each person as show below<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
I have top level access hence can check if they are abusing their privilege of being able to upload to the server.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;ric&quot;&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;unicenter&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / C:/uc_slimftpd_tutorial&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
Save and login to Dave's account. You will see three files. You can delete, download these files. Try uploading files.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;'''dave'''&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;'''dave123'''&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;'''C:/uc_slimftpd_tutorial/dave'''&amp;nbsp;&amp;nbsp;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
Repeat the same for Johns's account. Generally have a play with FTP'ing.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;'''john'''&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;'''john123'''&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / '''C:/uc_slimftpd_tutorial/john'''&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Multi User Hosting - Server example ==<br />
You have set-up three user accounts (Virtual Hosts) in Apache's configuration file and have their corresponding web sites located in the www folder under the following three sub-folder names user1, user2 and user3. They each need to use FTP to upload their site. All you need to do is add three new user profiles to the bottom of the FTP configuration file as follows.<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
All three sites map to the appropriate folder in www.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;dave_user1&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;fish123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;W:/www/user1/&amp;nbsp;&amp;nbsp;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
The most difficult part is the choice of user names and passwords.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;john_doe&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;dead123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / W:/www/user2/&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
Do not use their real names make sure the names and passwords are different and long and contain a mix of numeric and alpha characters.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;football_team&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;lost123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / W:/www/user3/&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Sharing Files ==<br />
John and Dave would like to have access to slimFTPd’s original unzipped files. For this I will create a virtual folder in the server’s root named “slim” and map folder slimFTPd to it. Notice I am not mapping the folder “original” because I don’t want them to have access to the zip file that it contains. Dave thinks he’s an artist! Well he likes to write over other peoples file hence will restrict him to read access only.<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
I have top level access hence can check if anyone is abusing their privileges.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;ric&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;unicenter&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / C:/uc_slimftpd_tutorial&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
First we create a virtual folder in root named &quot;'''slim'''&quot; and them map the real folder to it.<br />
<br />
All privileges are removed &quot;'''Deny /slim All'''&quot; and then '''allow''' Dave to '''Read''' and '''List''' the folder content.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;dave&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;dave123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / C:/uc_slimftpd_tutorial/dave&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All<br />
'''&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/slim&amp;nbsp;C:/uc_slimftpd_tutorial/original/slimftpd&amp;nbsp;'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Deny /slim All'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Allow /slim Read List'''&lt;br&gt;<br />
&lt;/User&gt;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
John is given access with no restrictions.<br />
<br />
Test this configuration in your browser or FTP client.<br />
<br />
When both accounts are accessed a new folder &quot;slim&quot; will be seen. John can add new material if he wishes however Dave the rave cannot.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;john&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;john123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / C:/uc_slimftpd_tutorial/john&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Mount /slim C:/uc_slimftpd_tutorial/original/slimftpd'''&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / All&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
The following provides another example of this:<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Sharing Files with friends ==<br />
On my home PC I am running these servers permanently and do not require portability (memory stick) and wish to share files between family members and friends. I have already provided them with an ftp name and password to use. I only want them to read files from '''c:/personal/area/images/''' and allow them to upload files to '''e:/personal/exchange/'''<br />
<br />
This type of scenario requires only one user profile: <br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-<br />
|style=&quot;background:#ffffff&quot;|<br />
All sub-folders in FTP root inherit the server root's permissions:<br />
<br />
# In this example all permissions are denied for root.<br />
# Explicitly grant '''Read''' and '''List''' to '''root'''.<br />
# These permissions are passed on to all sub-folders hence we need to explicitly grant '''Write''' to the '''upload''' folder.<br />
|style=&quot;background:#eeeeee&quot;|<br />
&lt;User &quot;family_and_friends&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;all123&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount /upload e:/personal/exchange/&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount /download c:/personal/area/images/&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Deny / All&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / Read List&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow /upload Write&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
== Summary ==<br />
Apart from the reliability of uploading pages to your web space an FTP sever has another powerful trick up it's sleeve. Not every one knows this because it's anonymous! Interested you should be, take a look at the [[SlimFTPd: Config Anonymous | next page]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Security]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Oily_Rag_1:_CD_Part_2&diff=4902Oily Rag 1: CD Part 22010-11-24T10:27:35Z<p>Upazixorys: </p>
<hr />
<div>=[http://uvetysudema.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc nav oily rag 1 CD}}<br />
'''USCD1 Plugin'''<br />
<br />
On the previous page I have shown how easy it is to modify Uniform Server 3.5-Apollo and have it running from a CD. You currently have a collection of old and new files neatly saved in folder '''uscd''', we now put these to good use by creating a test plugin for UniServer.<br />
<br />
'''Plugin'''<br />
<br />
This plugin is not overly complex it allows you to switch Uniform Server to CD mode where you can burn your design and then switch back to standard mode. To achieve switching two batches files are required one for each mode. Our design needs a reference point allowing relative paths to be used. Uniform Server already provides a '''plugins''' folder which meets our requirements.<br />
<br />
== Files and location ==<br />
Currently we have a collection of files in folder '''uscd''' these I have listed below. During switching these files are copied to the location shown. While copying each file its name is changed back to the original. To perform this copying we use two batch files '''cd_mode_switch.bat''' copies only the new files and '''us_mode_switch.bat''' copies original (old) files, thus switching between CD and normal Uniform Server mode respectively.<br />
<br />
{|cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#eeeeee&quot;<br />
|-<br />
!style=&quot;background:#d7d7d7&quot;|File<br />
!style=&quot;background:#d7d7d7&quot;|Location<br />
!&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#e6e6e6&quot;|new_httpd.conf&lt;br&gt;<br />
old_httpd.conf<br />
|style=&quot;background:#e6e6e6&quot;|*\Uniform Server\udrive\usr\local\apache2\conf<br />
|valign=&quot;middle&quot;|Apache<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#f5f5f5&quot;|new_my-small.cnf&lt;br&gt;<br />
old_my-small.cnf<br />
|style=&quot;background:#f5f5f5&quot;|*\Uniform Server\udrive\usr\local\mysql\bin<br />
|valign=&quot;middle&quot;|MySQL<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#e6e6e6&quot;|new_php.ini&lt;br&gt;<br />
old_php.ini<br />
|style=&quot;background:#e6e6e6&quot;|*\Uniform Serve\udrive\usr\local\php<br />
|valign=&quot;middle&quot;|PHP<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#f5f5f5&quot;|new_config.inc.php&lt;br&gt;<br />
old_config.inc.php<br />
|style=&quot;background:#f5f5f5&quot;|*\Uniform Serve\udrive\home\admin\www\phpMyAdmin<br />
|valign=&quot;middle&quot;|phpMyAdmin<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#e6e6e6&quot;|new_Server_Start.bat&lt;br&gt;<br />
old_Server_Start.bat<br />
|style=&quot;background:#e6e6e6&quot;|*\Uniform Server <br />
|valign=&quot;middle&quot;|UniServer Control<br />
|-valign=&quot;top&quot;<br />
|style=&quot;background:#f5f5f5&quot;|new_Stop.bat&lt;br&gt;<br />
old_Stop.bat<br />
|style=&quot;background:#f5f5f5&quot;|*\Uniform Server <br />
|valign=&quot;middle&quot;|UniServer Cont<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Preperation ===<br />
Create a new folder '''uscd1''' in folder *\Uniform Server\udrive\plugins now copy the folder '''uscd''' to '''uscd1'''.<br />
<br />
*'''Folder uscd1:''' Will contain two new batch files '''cd_mode.bat''' and '''us_mode.bat''' these call batch files '''us_mode_switch.bat''' and '''cd_mode_switch.bat''' respectively. They can be moved to the top level folder (Uniform Server) each file contains a single line of code hence are easily modified to run the main switching batch files. <br />
<br />
*'''Folder uscd:''' Will contain two new batch files '''cd_mode_switch.bat''' and '''us_mode_switch.bat''' these perform file copying and renaming. Strictly speaking these are the only two files required for switching.<br />
<br />
'''''Note'':''' Using four files provides a flexible architecture I prefer to have all my control files located in the top level folder you can choose whatever suits your need better.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Batch file commands ==<br />
Before looking at the batch files an understanding of the commands used will make the whole process easier to understand.<br />
<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!Batch Command<br />
!Explanation<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
pushd %~dp0<br />
....<br />
batch file code<br />
....<br />
popd<br />
&lt;/pre&gt; <br />
|<br />
* '''pushd''' Pushes the Current Directory onto a memory stack (Where you came from).<br />
* '''%~dp0''' This forces the current working directory to the current location of the batch file you are running. It includes the full path not just the drive letter (if its remote that’s included).<br />
* '''popd''' Restores the previously pushed directory (effectively returns control back to whatever call the batch file).<br />
|-style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
COPY switches source destination<br />
&lt;/pre&gt;<br />
|<br />
'''COPY switches source destination''' Copies one or more files to another location.<br />
<br />
'''''Source'':''' Complete path and name of the file to copy.<br />
<br />
'''''Destination'':''' Complete path and file name to where we wish to copy the above file. The file name can be different to that of the source file. (We use this to change names back to their originals)<br />
<br />
'''''Switches'':''' '''/Y''' Suppresses prompting to confirm you want to overwrite an existing destination file.<br />
|-style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
..\folder\file_name<br />
<br />
..\..\folder\file_name<br />
&lt;/pre&gt;<br />
|<br />
'''..\ not a DOS command''' Its a relative path name '''..\''' means move up one folder level '''..\..\''' move up two folder levels.<br />
<br />
..\folder_name\folder_name\file_name Move up one folder level and then start moving down following the folder names to the file name.<br />
<br />
'''''Note'':''' Relative to the current working directory (folder) as established above using pushd. <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
== us_mode_switch.bat ==<br />
Double click on this file and you are back to a default installation of Uniform Server (Well the files we have been using). The above comments also apply to this file.<br />
<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!us_mode_switch.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
rem File Name: us_mode_switch.bat<br />
rem Location: Uniform Server\udrive\plugins\uscd1\uscd<br />
rem Created By: UniCenter<br />
rem Comment: Run either directly or from folder Uniform Server using us_mode.bat<br />
rem Example plugin USCD1 3.5-Apollo<br />
rem Edited Last By: Mike Gleaves (Ric)<br />
rem 30-6-08 V1.0<br />
rem Tutorial Oily Rag 1: CD Part 2<br />
:======================================<br />
echo off<br />
cls<br />
rem === Set current working directory<br />
pushd %~dp0<br />
<br />
rem === Copy original files back to server<br />
rem == Uniserver control<br />
copy /Y old_Server_Start.bat ..\..\..\..\Server_Start.bat<br />
copy /Y old_Stop.bat ..\..\..\..\Stop.bat<br />
rem == Apache<br />
copy /Y old_httpd.conf ..\..\..\usr\local\apache2\conf\httpd.conf&quot; <br />
rem == MySQL<br />
copy /Y old_my-small.cnf ..\..\..\usr\local\mysql\bin\my-small.cnf&quot;<br />
rem == php<br />
copy /Y old_php.ini ..\..\..\usr\local\php\php.ini&quot;<br />
rem == phpMyAdmin<br />
copy /Y old_config.inc.php ..\..\..\home\admin\www\phpMyAdmin\config.inc.php&quot;<br />
echo.<br />
echo Switched to US Mode<br />
echo.<br />
pause<br />
popd<br />
&lt;/pre&gt; <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== cd_mode_switch.bat ==<br />
Double click on this file and you are ready to make a few beer coasters. It really does not require an explanation; you are copying new files and overwriting the old ones.<br />
<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!cd_mode_switch.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
rem File Name: cd_mode_switch.bat<br />
rem Location: Uniform Server\udrive\plugins\uscd1\uscd<br />
rem Created By: UniCenter<br />
rem Comment: Run either directly or from folder Uniform Server using cd_mode.bat<br />
rem Example plugin USCD1 3.5-Apollo<br />
rem Edited Last By: Mike Gleaves (Ric)<br />
rem 30-6-08 V1.0<br />
rem Tutorial Oily Rag 1: CD Part 2<br />
:======================================<br />
echo off<br />
cls<br />
rem === Set current working directory<br />
pushd %~dp0<br />
<br />
rem === Copy original files back to server<br />
rem == Uniserver control<br />
copy /Y new_Server_Start.bat ..\..\..\..\Server_Start.bat<br />
copy /Y new_Stop.bat ..\..\..\..\Stop.bat<br />
rem == Apache<br />
copy /Y new_httpd.conf ..\..\..\usr\local\apache2\conf\httpd.conf&quot; <br />
rem == MySQL<br />
copy /Y new_my-small.cnf ..\..\..\usr\local\mysql\bin\my-small.cnf&quot;<br />
rem == php<br />
copy /Y new_php.ini ..\..\..\usr\local\php\php.ini&quot;<br />
rem == phpMyAdmin<br />
copy /Y new_config.inc.php ..\..\..\home\admin\www\phpMyAdmin\config.inc.php&quot;<br />
echo.<br />
echo Switched to CD Mode<br />
echo.<br />
pause<br />
popd<br />
&lt;/pre&gt; <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== us_mode.bat ==<br />
An alternative method of running the above two files.<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!us_mode.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;margin:0;border:none&quot;&gt;<br />
rem Location: *\Uniform Server\udrive\plugins\uscd1<br />
<br />
uscd\us_mode_switch.bat<br />
&lt;/pre&gt; <br />
|} <br />
&lt;br&gt;<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!us_mode.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;margin:0;border:none&quot;&gt;<br />
rem Location: Uniform Server<br />
<br />
udrive\plugins\uscd1\uscd\us_mode_switch.bat<br />
&lt;/pre&gt; <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== cd_mode.bat ==<br />
Another alternative method of running the above two main files.<br />
<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!cd_mode.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;margin:0;border:none&quot;&gt;<br />
rem Location: *\Uniform Server\udrive\plugins\uscd1<br />
<br />
uscd\cd_mode_switch.bat<br />
&lt;/pre&gt; <br />
|} <br />
&lt;br&gt;<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!cd_mode.bat<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;margin:0;border:none&quot;&gt;<br />
rem Location: Uniform Server<br />
<br />
udrive\plugins\uscd1\uscd\cd_mode_switch.bat<br />
&lt;/pre&gt; <br />
|}<br />
<br />
== File Overview ==<br />
This shows where to place all the files.<br />
{| cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!File Overview<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
Uniform Server<br />
<br />
us_mode.bat Server_Start.bat<br />
cd_mode.bat Stop.bat uscd2.exe <br />
<br />
Uniform Server\udrive\plugins\uscd1<br />
<br />
cd_mode.bat us_mode.bat <br />
<br />
Uniform Server\udrive\plugins\uscd1\uscd<br />
<br />
new_php.ini old_php.ini new_Server_Start.bat old_Server_Start.bat<br />
cd_mode_switch.bat new_Stop.bat old_Stop.bat new_config.inc.php<br />
old_config.inc.php us_mode_switch.bat new_httpd.conf old_httpd.conf <br />
new_my-small.cnf old_my-small.cnf <br />
&lt;/pre&gt; <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
== How to use the plugin ==<br />
Before running the servers it is good practice to run either us_mode.bat or cd_mode.bat.<br />
<br />
* '''us_mode.bat''' If you are developing a web site this selects the normal Uniform Server mode.<br />
* '''cd_mode.bat''' When you are ready to transfer the servers and site/s to a CD run this batch file to setup CD mode. There is no need to start the servers just copy folder Uniform Server and all its content to a CD.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Download ==<br />
Download this overlay (plugin USCD1) file [[Oily Rag 1: Downloads#CD Part 2| CD Part 2]] copy the file to folder Uniform Server double click to extract the files. See above file overview for details of file locations.<br />
<br />
== What's next ==<br />
The above is a solid foundation for producing a plugin, it can be used as is but lacks features that a real plugin should have. [[Oily Rag 1: CD Part 3|Part 3]] revisits what we currently have and resolves these shortcomings. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Oily Rag]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_CLI:_Process_Running&diff=4901PHP CLI: Process Running2010-11-24T10:27:31Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://uwujojedeh.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
----<br />
=[http://uwujojedeh.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Uc nav PHP CLI}}<br />
'''''PHP CLI Check if a process (program) is running'''''<br />
<br />
One the previous page I covered installing extension '''php_win32ps.dll''' which allows you to list statics for all currently running processes. This page covers using the extension to check if a process is running strictly speaking this extension is not required. UniSerer already includes a small utility that performs a similar function it has the extra capability of killing a named process. For completeness both are covered allowing you to select the most suitable for your application.<br />
<br />
'''General note:''' ''Always consider alternatives however never be temped to use something that is OS version specific! A particular utility may not be included across the whole family range (XP,Vista etc) or may be renamed between OS versions. Always go for the lowest common denominator otherwise your scripts will be killed when run on another machine that is not running a compatible OS version.''<br />
== Initial test setup ==<br />
'''''Note'':''' ''It really is a shame; still unable to find a version of php_win32ps.dll that is compatible with PHP 5.3.0 hence for these examples I am assuming you are running one of the UniServer Mona series. At UniServer pskill.exe and the reset of this tutorial will switch back to using Uniform Server 5.0-Nano.''<br />
<br />
Edit our two test files '''Run.bat''' and '''test_1.php''' contained in folder UniServer to have the following content:<br />
{|<br />
|-<br />
|'''''Run.bat'''''||'''''test_1.php''''';<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
TITLE CLI TEST BAT<br />
COLOR B0<br />
@echo off<br />
cls<br />
echo.<br />
udrive\usr\local\php\php.exe test_1.php<br />
echo.<br />
pause<br />
&lt;/pre&gt;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
print_r(win32_ps_list_procs());<br />
echo &quot;Hello World&quot;;<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
'''''Note'':''' Above assumes you have installed the extension '''php_win32ps.dll''' as described on the [[PHP CLI: PHP INI#Extension download | previous page]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Extension '''''php_win32ps.dll''''' ==<br />
Run the batch file (double click on Run.bat), all current running processes are displayed along with some useful statistics.<br />
<br />
=== Reduce output ===<br />
Running the above example produces an overwhelming amount of data lets reduce this by displaying only '''pids''' and '''executable path-names''', edit test_1.php as follows:<br />
&lt;pre&gt;<br />
&lt;?php<br />
//print_r(win32_ps_list_procs());<br />
<br />
@$processList = win32_ps_list_procs();<br />
foreach ($processList as $processArray)<br />
{<br />
$pid = $processArray['pid'];<br />
$exe = $processArray['exe'];<br />
echo &quot;$pid $exe \n&quot;;<br />
}<br />
//echo &quot;Hello World&quot;;<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
This produces a list of all running processes similar to this small extract:<br />
&lt;pre&gt;<br />
3240 C:\Program Files\Mozilla Firefox\firefox.exe<br />
3660 C:\WINDOWS\System32\svchost.exe<br />
3796 F:\uc_media_wiki\Uniform Server\unicon.exe<br />
3640 Z:\usr\local\apache2\bin\Apache.exe<br />
3900 Z:\usr\local\mysql\bin\mysqld-opt.exe<br />
1396 Z:\usr\local\apache2\bin\Apache.exe<br />
2788 C:\Program Files\JGsoft\EditPadLite\EditPadLite.exe<br />
3484 C:\WINDOWS\system32\cmd.exe<br />
2988 C:\WINDOWS\system32\cmd.exe<br />
2916 H:\z_test_42\UniServer\udrive\usr\local\php\php.exe<br />
…… etc<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Check a process is running ===<br />
This script shows how to target a process by name (example targets '''cmd.exe''') and check if it is currently running, change '''test_1.php''' as follows:<br />
&lt;pre&gt;<br />
&lt;?php<br />
$processName = 'cmd.exe';<br />
@$processList = win32_ps_list_procs();<br />
foreach ($processList as $processArray){<br />
$pid = $processArray['pid'];<br />
$exe = $processArray['exe'];<br />
if (basename($processArray['exe']) == $processName){<br />
echo &quot;\n Process $processName is running\n&quot;;<br />
echo &quot;$pid $exe \n&quot;;<br />
break;<br />
}<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
Run the batch file (double click on Run.bat) output will be similar to this:<br />
&lt;pre&gt;<br />
Process cmd.exe is running<br />
1896 C:\WINDOWS\system32\cmd.exe<br />
&lt;/pre&gt;<br />
The above can be converted into a function for general purpose however there is a small problem.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Problem ===<br />
I purposefully masked an issue with the above script. Comment out the break line as shown. <br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$processName = 'cmd.exe';<br />
@$processList = win32_ps_list_procs();<br />
foreach ($processList as $processArray){<br />
$pid = $processArray['pid'];<br />
$exe = $processArray['exe'];<br />
if (basename($processArray['exe']) == $processName){<br />
echo &quot;\n Process $processName is running\n&quot;;<br />
echo &quot;$pid $exe \n&quot;;<br />
// break;<br />
}<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
Run the batch file (double click on Run.bat) several times<br />
<br />
Result similar to this&gt;<br />
&lt;pre&gt;<br />
Process cmd.exe is running<br />
3860 C:\WINDOWS\system32\cmd.exe<br />
<br />
Process cmd.exe is running<br />
604 C:\WINDOWS\system32\cmd.exe<br />
<br />
Process cmd.exe is running<br />
3788 C:\WINDOWS\system32\cmd.exe<br />
&lt;/pre&gt;<br />
|}<br />
There are three command processes running each with an identical name, if you were to kill the process by name all three processes are killed. To kill a single process use its PID this is always unique.<br />
<br />
If you wish to avoid this issue and kill processes by name make sure each process has a '''unique name'''.<br />
<br />
Note:<br />
<br />
You may see only a single cmd process running, if that is the case open a few command prompts before running the script. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Kill process by name ===<br />
This script uses a function to kill a named process, edit test_1.php and run the script (Run.bat)<br />
&lt;pre&gt;<br />
&lt;?php<br />
kill_proc(&quot;cmd.exe&quot;);<br />
<br />
function kill_proc($processName){<br />
@$processList = win32_ps_list_procs();<br />
foreach ($processList as $processArray){<br />
$pid = $processArray['pid'];<br />
if (basename($processArray['exe']) == $processName){ <br />
`taskkill /f /PID $pid 2&gt;&amp;1`; <br />
}<br />
}<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
Well if you are running XP-Pro '''Run.bat''' will have been killed. However if you are running XP-Home the process is not killed with '''taskkill'''. To keep both XP-Pro and XP-Home happy change the script to:<br />
&lt;pre&gt;<br />
&lt;?php<br />
kill_proc(&quot;cmd.exe&quot;);<br />
<br />
function kill_proc($processName){<br />
@$processList = win32_ps_list_procs();<br />
foreach ($processList as $processArray){<br />
$pid = $processArray['pid'];<br />
if (basename($processArray['exe']) == $processName){ <br />
`tskill $pid `; <br />
}<br />
}<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
There is no end of these examples where an XP-Pro user (designer) never seeing or considering this type of issue, anyway I think the above vindicates my '''general note''' in the opening statement.<br />
<br />
That said I have not confirmed (by testing) if '''tskill''' works on XP-pro or Vista family. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Clean up ==<br />
At this stage we have finished exploring extension '''php_win32ps.dll''' and have no further use for file '''php-cli.ini'''.<br />
<br />
I like to remove clutter if you feel the same delete the following:<br />
* Delete folder: UniServer\udrive\usr\local\php\'''new_extensions'''<br />
* Delete file: UniServer\udrive\usr\local\php\'''php-cli.ini'''<br />
* Pack away UniServer Mona<br />
* The remainder of this tutorial uses UniServer Nano<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== UniServer pskill.exe ==<br />
UniServer '''pskill.exe''' utility is battle harden, by this I mean, beta testers have proven its functionality across both XP and Vista families and beta release of Windows 7.<br />
<br />
It a dual function utility, can kill a named process or check if a named process is running.<br />
<br />
'''Note: From here on I am assuming you are using UniServer 5.0-Nano or above'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Initial test setup ===<br />
Edit our test file '''Run.bat''' contained in folder UniServer to have the following content:<br />
{|<br />
|-<br />
|'''''Run.bat'''''<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
TITLE CLI TEST BAT<br />
COLOR B0<br />
@echo off<br />
cls<br />
echo.<br />
usr\local\php\php.exe -n test_1.php<br />
echo.<br />
pause<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Check a process is running ===<br />
Edit our test file '''test_1.php''' contained in folder UniServer to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php''''';<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$exe_name = &quot;notepad.exe&quot;; // process to check<br />
$command= &quot;unicon\program\pskill.exe $exe_name&quot;; // command line to be run <br />
exec($command,$dummy,$return); // 0=running 1=not-running <br />
<br />
if($return == 0){ // Check return value<br />
echo &quot; $exe_name Is running&quot;;<br />
}<br />
else{<br />
echo &quot; $exe_name Not running&quot;;<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''Test 1'':'''<br />
<br />
* Run Notepad<br />
* Run the batch file (double click on Run.bat), Process running displayed<br />
<br />
'''''Test 2'':'''<br />
<br />
* Close Notepad (and any other open Notepads)<br />
* Run the batch file (double click on Run.bat), Process Not running displayed<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Function exec() ====<br />
This function exec($command,$dummy,$return) runs the utility pskill.exe and collects data returned.<br />
{|<br />
|-<br />
|* '''$command''' || - Command that will be executed. Path to program to run (pskill.exe) and any parameters to pass to it. <br />
|-<br />
|* '''$dummy''' || - Dummy array filled with every line of output from pskill. We ignore this data. Must have some variable here hence <br />
|-<br />
|* '''$return''' || - This variable holds returned error code from pskill. Named process running = 0 not running = 1 <br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Kill process by name ===<br />
Edit our test file '''test_1.php''' contained in folder UniServer to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$exe_name = &quot;notepad.exe&quot;; // process to kill<br />
<br />
// command line to be run note c as second parameter kills<br />
// the above named process <br />
<br />
$command= &quot;unicon\program\pskill.exe $exe_name c&quot;; <br />
exec($command); // runs command <br />
exit(0); // Script ran OK<br />
?&gt;<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
&lt;br /&gt;<br />
'''''Test'':'''<br />
* Run Notepad<br />
* Run the batch file (double click on Run.bat), Closes (kills) Notepad<br />
<br />
'''''Note'':'''<br />
<br />
Function exec($command) only a single parameter is required we are ignoring any returned data.<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
The real point of this part of the tutorial was the introduction to '''UniServer’s pskill.exe''' with its ability to check for a running process and if required to kill it. It kills by process name not by PID not a real issue if you have control of naming the process (program).<br />
<br />
Interestingly to build a fully functional CLI script you require several snippets of code that target problem areas. Consider this scenario, when a script starts another process it generally has to wait for that process to end before executing the next instruction.<br />
<br />
Not a problem if you are going to process data from that process; however if all you want to do is kick the process off and then continue, your script will appear to hang if the process takes a long time or never terminates.<br />
<br />
A solution to this scenario is covered on the [[PHP CLI: Detached Processes | '''next page''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || '''MPG''' (Ric)<br />
|}<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=SSL_Part_2:_PHP_mail_function&diff=4900SSL Part 2: PHP mail function2010-11-24T10:25:49Z<p>Upazixorys: </p>
<hr />
<div>=[http://ybyfonojot.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
SSL Part 2: <br />
[[SSL Part 2: Home | Home]] | <br />
[[SSL Part 2: PC Lock Down | Lock Down]] | <br />
[[SSL Part 2: No IP | No IP]] | <br />
[[SSL Part 2: Installing hMailServer | hMailServer]] |<br />
[[SSL Part 2: Configure hMailServer | Config hMailServer]] | <br />
[[SSL Part 2: PHP mail function |PHP mail function]] | <br />
[[SSL Part 2: Generate CSR |Generate CSR]] | <br />
[[SSL Part 2: CAcert Introduction |CAcert]] | <br />
[[SSL Part 2: CAcert Signing Process |CAcert Signing Process]]<br />
<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''PHP mail function problem'''&lt;br&gt;'''Signed Certificate Project'''&lt;br&gt;Uniform Server 3.5-Apollo'''<br />
|}<br />
With your e-mail server working I suppose one of the first things to try is PHP’s mail function. A very simple looking function with the power to make you rip your hair out when you discover it does not work.<br />
<br />
The truth is it does work, in reality it’s a lack of understanding, which this page attempts to address. When I used this function for the first it failed imagine my surprise when I discovered it required a mail server. Even after acquiring a mail server it persistently refused to work.<br />
<br />
Most problems are solvable however first you need to understand what the failure mechanism is. The following examples use our mail-sever as describe on the previous two pages to investigate PHP’s mail function and server interaction.<br />
<br />
== Basic PHP mail function ==<br />
All examples use a variant of the following script running on Uniform Server 3.5-Apolo. I assume you have set-up your email client with a “postmaster” account ([[SSL Part 2: Configure hMailServer | see previous page]])<br />
<br />
{|<br />
|-<br />
|<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
! mail_test_1.php<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;Mail Test 1&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
<br />
&lt;?php<br />
$to_email = &quot;postmaster@mpg123.no-ip.org&quot;; <br />
$subject = &quot;Mail Test 1&quot;; <br />
$message = &quot;Basic PHP mail function&quot;;<br />
<br />
if (mail($to_email,$subject,$message)){<br />
echo '&lt;br&gt;Mail accepted for delivery&lt;br&gt;';<br />
}<br />
else{<br />
echo 'There was an error. Mail not accepted for delivery';<br />
}<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/pre&gt;<br />
|}<br />
|valign=&quot;top&quot;|<br />
'''Test 1:'''<br />
{|<br />
|-<br />
|'''Run script:'''||Type into your browser &lt;nowiki&gt;http://localhost/mail_test_1.php&lt;/nowiki&gt;<br />
|-<br />
|'''Result:'''||Mail accepted for delivery<br />
|-<br />
|'''Email client:'''||style=&quot;background:#e8e8e8;&quot;|From: me@localhost.com<br />
|-<br />
|&amp;nbsp;||Subject: Mail Test 1<br />
|}<br />
<br />
The script clearly works, mailed was delivered to our recipient “postmaster” perhaps what is a little surprising is where the mail came from me@localhost.com!<br />
<br />
That e-mail address does not exist, either in our script or e-mail server. A recipient wanting to reply clearly would have a problem.<br />
<br />
The address is automatically added by PHP. Address used is that set in the '''php.ini''' file located in folder *\Uniform Server\udrive\usr\local\php.<br />
<br />
Line 617: '''sendmail_from = me@localhost.com'''<br />
|}<br />
<br />
Suppose you want all your PHP e-mail scripts to reply to a single address changing the php.ini file to that address would achieve the result required. To see this in action change the line in php.ini to '''sendmail_from = me2@localhost.com''' run the above script again. This is a small change to illustrate a point and not a practical solution.<br />
<br />
'''''Note''''': The above is '''extremely important''' you need to think of the combined script and php.ini as a mini-smtp server. It will only relay (deliver) mail to the local server (Line 614: smtp_port = 25) and to a single account defined by (Line 617) sendmail_from = me2@localhost.com.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Basic PHP mail function - Problem ==<br />
The above demonstrates our script and mail server are working. This next test I am sure you will be familiar with or at least the resulting error message. Change the script, replace to email address with your real e-mail address (as provided by your ISP)<br />
<br />
{|<br />
|-<br />
|<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
! mail_test_2.php<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;Mail Test 1&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
<br />
&lt;?php<br />
$to_email = &quot;real_name@real_domain&quot;; <br />
$subject = &quot;Mail Test 2&quot;; <br />
$message = &quot;Basic PHP mail function&quot;;<br />
<br />
if (mail($to_email,$subject,$message)){ // Line 10<br />
echo '&lt;br&gt;Mail accepted for delivery&lt;br&gt;';<br />
}<br />
else{<br />
echo 'There was an error. Mail not accepted for delivery';<br />
}<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/pre&gt;<br />
|}<br />
|valign=&quot;top&quot;|<br />
'''Test 2:'''<br />
{|<br />
|-<br />
|'''Run script:'''||Type into your browser &lt;nowiki&gt;http://localhost/mail_test_2.php&lt;/nowiki&gt;<br />
|-<br />
|'''Result:'''||style=&quot;background:#e8e8e8;&quot;|<br />
'''Warning: mail() [function.mail]: SMTP server response: 550 Delivery is not allowed to this address. in W:\www\mail_test_1.php on line 10'''&lt;br&gt;<br />
There was an error. Mail not accepted for delivery<br />
|}<br />
Error 550 means that this mail server does not allow relaying!<br />
The address (implied) on line 10 is your real e-mail address!<br />
<br />
'''Test:''' Using the '''postmaster account''' you set-up in your client. send yourself an email (to your ISP email account).<br />
<br />
The test demonstrates you can relay email through your email server, to your ISP and receive mail. Clearly the above error message is not referring to your real address.<br />
<br />
Remember the importance of test 1! Its referring to that address from the mini-smtp server. '''The problem is our local mail server sees this as an external server'''.<br />
|}<br />
<br />
----<br />
The answer to the problem is on [[SSL Part 2: Configure hMailServer| this page]] Internet IP ranges section 10 it defines what is allowed to relay through the server. I have reproduced the image below:<br />
{|<br />
|-<br />
|<br />
[[Image:Uc_hms_config_8.gif]]<br />
|valign=&quot;top&quot;|<br />
A quick and disastrous solution is to check the bottom box and allow external-to-external relaying.<br />
<br />
This would be '''instant death''' for any e-mail server, not only would you be blacklisted but you open your server for every one to use where they can relay all unsavory stuff and spam.<br />
<br />
'''''Solution:'''''<br />
<br />
The solution is interesting all four selectable options have one thing in common '''accounts'''!<br />
<br />
Does our mini-server '''me2@localhost.com''' have an account on our hMailServer of course not we never set one-up.<br />
<br />
Do we have a domain '''localhost.com''' well we never set that up either.<br />
<br />
You can set-up an account for me2@localhost.com in any domain however it is preferable to create a new domain just in case you delete the one it resides in killing off all your PHP scripts.<br />
<br />
'''Creating a new domain and account see below:'''<br />
|} <br />
----<br />
{|<br />
|-<br />
|<br />
[[Image:Uc_hms_php_mail_1.gif]]<br />
|valign=&quot;top&quot;|<br />
<br />
'''Create new domain:'''<br />
<br />
# Login to hMailServer<br />
# Click '''Welcome''' (left menu)<br />
# Click '''Add domain''' (right page)<br />
# Domain name: Enter '''localhost.com'''<br />
# Catch-all address: Enter '''me2''' and '''localhost.com'''<br />
# Click '''Save'''<br />
|} <br />
----<br />
{|<br />
|-<br />
|<br />
[[Image:Uc_hms_php_mail_2.gif]]<br />
|valign=&quot;top&quot;|<br />
<br />
'''Create new account:'''<br />
<br />
For the catch-all address to become active it requires an account.<br />
<br />
# Account address: Enter me2<br />
# Password: Enter a password (me2pass)<br />
# Click Save<br />
''<br />
'''Note''''': The password is required only to create the account it is never used by scripts.<br />
|}<br />
<br />
----<br />
'''Re-Run:'''<br />
<br />
Repeat the original test:<br />
{|<br />
|-<br />
|'''Run script:'''|| Type into your browser &lt;nowiki&gt;http://localhost/mail_test_2.php&lt;/nowiki&gt;<br />
|-<br />
|'''Result:'''||styple=&quot;background:#efefef&quot;| '''Mail accepted for delivery''' Indicates mail was sent (Script is working!)<br />
|-<br />
|'''Mail Client:'''&amp;nbsp;&amp;nbsp;&amp;nbsp;|| Wait for the mail to be delivered. After a reasonable time refresh your e-mail client.<br />
|-<br />
|'''Result:'''||styple=&quot;background:#efefef&quot;|From: '''me2@localhost.com'''<br />
|-<br />
|&amp;nbsp;||Subject: Mail Test 2<br />
|}<br />
<br />
Both hMailServer and PHP has been set-up correctly however that strange from address (me2@localhost.com) needs resolving. You have two options depending on your requirements.<br />
<br />
'''''1) Common address'''''<br />
<br />
If all your scripts expect all recipients to reply to a single address you can change php.ini and hMailServer to reflect that address.<br />
<br />
'''''2) Generic address'''''<br />
<br />
Solution one is specific and inflexibly however you have a server that is capable of relaying any standard e-mail. The real solution lies in PHP’s mail function and the use of its fourth parameter covered in the next section. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Basic PHP mail function - Reply address ==<br />
PHP's basic mail function allows you to specify a fourth parameter. This parameter is primarily used for inserting MIME types however it also allows you to specify a “from address”.<br />
<br />
{|<br />
|-<br />
|<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
! mail_test_3.php<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
&lt;pre style=&quot;border:none&quot;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;&lt;title&gt;Mail Test 3&lt;/title&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
<br />
&lt;?php<br />
$to_email = &quot;real_name@real_domain&quot;; <br />
$subject = &quot;Mail Test 3&quot;; <br />
$message = &quot;Basic PHP mail function&quot;;<br />
$from = &quot;fred@someone.com&quot;;<br />
<br />
$headers =&quot;From: &quot;. $from . &quot;\r\n&quot;;<br />
<br />
if (mail($to_email,$subject,$message,$headers)){<br />
echo '&lt;br&gt;Mail accepted for delivery&lt;br&gt;';<br />
}<br />
else{<br />
echo 'There was an error. Mail not accepted for delivery';<br />
}<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/pre&gt;<br />
|}<br />
|valign=&quot;top&quot;|<br />
'''Test 3:'''<br />
{|<br />
|-<br />
|'''$from:'''||Set this variable to the e-mail address you wish a recipient to reply to.<br />
|-<br />
|'''''Note:'''''|| The $headers string created must include \r\n to define a MIME boundary without it some mail clients may throw a wobbly!<br />
|}<br />
<br />
<br />
<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|'''Run script:'''||Type into your browser &lt;nowiki&gt;http://localhost/mail_test_3.php&lt;/nowiki&gt;&lt;br&gt;Wait a short time for the mail to be delivered and then read your e-mail.<br />
|-<br />
|'''Result:'''||style=&quot;background:#efefef&quot;|The from address will display '''fred@someone.com'''<br />
|}<br />
|}<br />
<br />
==Summary ==<br />
I hope you found the above digression of interest; PHP’s basic mail function always seems to give new users grief. I faced the same problem because of a basic lack of understanding; thinking in terms of a mini-smtp server helps to visualise the problem. You may be interested in alternative solutions there are two covered on this page.<br />
<br />
Enough of this lets continue with our quest for a [[SSL Part 2: Generate CSR |signed certificate]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Application]]<br />
[[Category: Development]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Reverse_Proxy_Server_2:_IIS_back-end_server&diff=4899Reverse Proxy Server 2: IIS back-end server2010-11-24T10:25:45Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ogetehuvo.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ogetehuvo.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Nav reverse proxy server}}<br />
<br />
'''Uniform Server - IIS'''<br />
<br />
Apache is an awesome web server. It will even run ASP applications. Just install [http://www.apache-asp.org/ Apache::ASP] and you are ready to go. Alternatively, you could use that redundant IIS server sitting on your machine and run the appropriate ASP apps from it.<br />
<br />
'''''IIS Server'''''<br />
<br />
Hey! No way am I suggesting making it your main server. It needs to be put in its place and that’s as a back-end server. On the previous page you saw how easy it is to run Uniform Server as a proxy. Make the modifications to your main server and this gives you Apache and MySQL as a powerful combination, now proxy to IIS. OK, IIS sucks for anything but using ASP.Net, however at least you will have a set-up to explore.<br />
<br />
'''''Pain'':'''<br />
<br />
IIS is a pain when you try to tweak it; have a go at setting it as a proxy server and you will get some idea what I mean. Apache does it straight out of the box. In theory you should be able to run all your servers on port 80 and bind to different IP addresses. However IIS is a royal pain and grabs everything associated with the port it’s running on and that includes every IP address on the machine.<br />
<br />
That said it is relatively easy to change the port it runs on, however it is version specific. Below I have listed the common versions. Full details for other versions can be found at [http://support.microsoft.com/kb/149605 Microsoft support].<br />
<br />
== Change IIS port ==<br />
Change the IIS port for example 8080 using Internet Service Manager, each site must bind to port 8080. <br />
<br />
{|width=&quot;600&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
! Microsoft Internet Information Server version 3.0 <br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
# Open Internet Service Manager.<br />
# Double-click on the computer corresponding to the WWW service.<br />
# On the Service tab, change the TCP Port field to the desired port number (8080).<br />
# Click OK.<br />
# Using the Internet Service Manager, stop and restart the IIS Services.<br />
|}<br />
&lt;br&gt;<br />
{|width=&quot;600&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
! Microsoft Internet Information Services versions 4.0 to 6.0 <br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
# Open Internet Service Manager or Internet Information Services (IIS) Manager.<br />
# If necessary, expand the Web server that you want, and then expand Web Sites.<br />
# Right-click the Web site that you want to change.<br />
# Click Properties.<br />
# Click the Web Site tab.<br />
# Change the TCP Port Number in the TCP Port edit box (or click Advanced for multiple Port settings).<br />
# Click OK to save the changes.<br />
|}<br />
<br />
Load your ASP apps and check that they run.<br />
<br />
== Vhost Set-up ==<br />
The set-up is similar to that shown on the previous page. Edit configuration file C:\server_a\UniServer\usr\local\apache2\conf\httpd.conf\'''httpd.conf'''<br />
<br />
{|cellpadding=&quot;6&quot;<br />
|-<br />
|valign=&quot;top&quot;|<br />
&lt;pre&gt;<br />
NameVirtualHost *<br />
&lt;VirtualHost *&gt;<br />
ServerName localhost:80<br />
DocumentRoot /www<br />
<br />
ProxyRequests off<br />
&lt;Proxy *&gt;<br />
Order deny,allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/Proxy&gt;<br />
<br />
ProxyPassReverse / http://localhost:8080/<br />
<br />
RewriteEngine On<br />
# Add a rewrite rule for each .Net app you wish to proxy.<br />
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]<br />
<br />
&lt;/VirtualHost&gt;<br />
&lt;/pre&gt;<br />
|<br />
'''''Notes'':'''<br />
<br />
Note: port 8080 If you set a different port for IIS use that<br />
|}<br />
<br />
Depending on your application you may need to preserve host headers. Try something like this:<br />
{|cellpadding=&quot;6&quot;<br />
|-<br />
|valign=&quot;top&quot;|<br />
&lt;pre&gt;<br />
NameVirtualHost *<br />
&lt;VirtualHost *&gt;<br />
ServerName localhost:80<br />
DocumentRoot /www<br />
<br />
ProxyRequests off<br />
&lt;Proxy *&gt;<br />
Order deny,allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/Proxy&gt;<br />
<br />
RewriteEngine On<br />
ProxyVia Block<br />
ProxyPreserveHost On<br />
# Add a rewrite rule for each .Net app you wish to proxy.<br />
RewriteRule ^/DotNetApp(.*)$ http://localhost:8080/DotNetApp/$1 [P,L]<br />
<br />
&lt;/VirtualHost&gt;<br />
&lt;/pre&gt;<br />
|<br />
<br />
'''''Notes'':'''<br />
<br />
Note: port 8080 If you set a different port for IIS use that<br />
|}<br />
<br />
== Summary ==<br />
It’s a shame! I have no examples for you to run, however the above shows the basic principals of proxying to IIS.<br />
<br />
That really is the end of this tutorial series.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
{|<br />
|-valign=&quot;middle&quot;<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]] <br />
|}<br />
<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Stunnel:_SSL_Certificate&diff=4898Stunnel: SSL Certificate2010-11-24T10:25:29Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://isiqilujev.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://isiqilujev.co.cc CLICK HERE]=<br />
----<br />
</div><br />
----<br />
&lt;div style=&quot;background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;&quot;&gt;<br />
----<br />
=[http://isiqilujev.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://isiqilujev.co.cc CLICK HERE]=<br />
----<br />
&lt;/div&gt;<br />
&amp;lt;span id=&amp;quot;top&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;<br />
&amp;lt;div style=&amp;quot;padding:0;margin:0; border-bottom:3px inset #000000&amp;quot;&amp;gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Stunnel: <br />
[[Stunnel: Home | Home]] | <br />
[[Stunnel: Upgrade 4.24 | Upgrade 4.24]] | <br />
[[Stunnel: Install 4.24 | Install]] | <br />
[[Stunnel: SSL Certificate | SSL Certificate]] |<br />
[[Stunnel: Single Vhost | Single Vhost]] | <br />
[[Stunnel: Resolved | Resolved]] | <br />
[[Stunnel: Basics | Basics]] | <br />
[[Stunnel: Cost | Cost]] | <br />
[[Stunnel: Original | Original]]<br />
|}<br />
&amp;lt;/div&amp;gt;<br />
{| cellpadding=&amp;quot;2&amp;quot;<br />
|<br />
__TOC__<br />
||<br />
'''Stunnel SSL Certificate and Key generation'''&amp;lt;br&amp;gt;'''Final Stunnel Test'''&amp;lt;br&amp;gt;'''Uniform Server 3.5-Apollo'''<br />
|}<br />
Before going live with your secure server it is '''imperative''' you generate a '''new certificate''' and '''public key''' for Stunnel. The process is extremely easy, first shut down both servers and follow the instructions below.<br />
<br />
== Generating a certificate ==<br />
The batch files '''mpg_create.bat''' allows you to create the private key and public key (certificate) in one go.<br />
<br />
The file is located in folder: '''&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;\Uniform Server\udrive\home\admin\www\plugins\stunnel_424\bin'''<br />
<br />
# If running shut down your servers.<br />
# To start the process double click on the batch file '''mpg_create.bat'''.<br />
# First the private key is automatically created and requires no input from you.<br />
# The next phase is a Certificate Signing Request (CSR).&amp;lt;br&amp;gt;During this generation process you will be prompted for several pieces of information. These are the X.509 attributes of the certificate.<br />
# I have highlighted in bold the type of information you enter.<br />
<br />
<br />
{|cellpadding=&amp;quot;4&amp;quot; <br />
|width=&amp;quot;20&amp;quot;|<br />
|style=&amp;quot;background:#f8f8f8;border:1px solid #cccccc&amp;quot;|<br />
Country Name (2 letter code) [PL]:'''UK'''&amp;lt;br&amp;gt;<br />
State or Province Name (full name) [Some-State]:'''Cambridgeshire'''&amp;lt;br&amp;gt;<br />
Locality Name (eg, city) []:Cambridge&amp;lt;br&amp;gt;<br />
Organization Name (eg, company) [Stunnel Developers Ltd]:'''Mike Gleaves UniCenter'''&amp;lt;br&amp;gt;<br />
Organizational Unit Name (eg, section) []:'''Uniform Server 3.5-Apollo example'''&amp;lt;br&amp;gt;<br />
Common Name (FQDN of your server) [127.0.0.1]:'''fred.gotdns.com'''&amp;lt;br&amp;gt;<br />
Press any key to continue<br />
|}<br />
<br />
<br />
You can repeat this process at any time, '''have a play''' and get a feel for what’s going on. The information you enter is unimportant with the exception of '''FQDN''' (fully qualified domain name) if you have one use it (its the full address you would enter in a browser apart from the http:// bit).<br />
<br />
'''''Note 1''''': A default value is displayed in square brackets press return to accept this value. If you are feeling lazy press return at each prompt. The resulting certificate is fully functional however it does not look very professional when displayed in a browser.<br />
<br />
'''''Note 2''''': '''The only thing of importance each certificate you generate is unique'''.<br />
<br />
It really is that easy to produce a self signed certificate to secure your personal server. If you want some background information take a look at this page SSL basics.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Ports ==<br />
<br />
'''Port 80'''<br />
<br />
This is the standard port for unsecured web page servers, Uniform Server (Apache) defaults to this. If you have changed this default setting you need to change Stunnel’s configuration file to match your new port.<br />
<br />
'''Port 443'''<br />
<br />
This is the standard port for secure web page servers and Stunnel’s default setting. If you need to use a different port change Stunnel’s configuration file as required.<br />
<br />
'''Internet access'''<br />
<br />
When you put your servers (Apache and Stunnel) online you must have ports '''80''' and '''443 open''' for public access otherwise your servers will be inaccessible. Make sure your firewall does not block these ports. In addition if you are using a wireless router (or other router) remember to forward both ports 80 and 443.<br />
<br />
'''''Note''''': If you have changed the ports use these values instead.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Help ==<br />
I have purposely avoided showing how to set the ports on your firewall or router. The reason being each firewall and router use different methods; however do not be discouraged there is a complete site dedicated to this [http://portforward.com/&amp;quot; portforward.com].<br />
<br />
I your firewall or router is not listed on this site then it does not exist, yes it’s that comprehensive. Start from this [http://portforward.com/guides.htm guides page].<br />
<br />
'''''[[#top | Top]]'''''<br />
== Not sure – Port bashing ==<br />
You have opened your server ports or have you? Now would be a good time to check that you were successful. This next site is a must visit Gibson Research its where you can get a free bashing or more acutely port probing.<br />
<br />
Towards the end of this page click the link ShieldsUP, at the bottom of this new page click precede which takes you to the main ShieldsUP page. (You need to follow the links in the above that’s the way it works). Once you have navigated to the page you will find this control panel:<br />
<br />
[[Image:Uc_shieldsup.gif]]<br />
<br />
To perform a full port scan (probe) click the '''All Service Ports''' link. When the test completes you will see two '''red squares''' one for each port (80 and 443) indicating your servers are accessible. Do not be alarmed by the fail message you opened these ports however if you see any other ports open its probably wise to check these out.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Fully secure server ==<br />
Your web site is public on '''both''' the secure (port 443) and insecure (port 80) ports. This means users can access your pages using either a secured or unsecured connection. You may only want access via the secure port, to achieve this either block incoming port 80 in your firewall or disable port forwarding for port 80 in you router.<br />
<br />
Confirm you have correctly disabled port 80 by repeating the port probe at Gibson Research.<br />
<br />
== Conclusion ==<br />
I have shown how easy it is to use Stunnel for a '''personal secure server'''. If you need more detail check out the additional pages [[Stunnel: Resolved | Resolved]], [[Stunnel: Basics | Stunnel Basics]] and [[Stunnel: Original | Stunnel Original write-up]] these I separated out for clarity.<br />
<br />
Perhaps you do not wish to secure your entire server but only a single virtual host. I have had several requests how to-do this which I cover on the next page [[Stunnel: Single Vhost | Securing a Single Vhost]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Application]]<br />
[[Category: Development]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Stunnel:_SSL_Certificate&diff=4895Stunnel: SSL Certificate2010-11-24T10:24:57Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://isiqilujev.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://isiqilujev.co.cc CLICK HERE]=<br />
----<br />
</div><br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Stunnel: <br />
[[Stunnel: Home | Home]] | <br />
[[Stunnel: Upgrade 4.24 | Upgrade 4.24]] | <br />
[[Stunnel: Install 4.24 | Install]] | <br />
[[Stunnel: SSL Certificate | SSL Certificate]] |<br />
[[Stunnel: Single Vhost | Single Vhost]] | <br />
[[Stunnel: Resolved | Resolved]] | <br />
[[Stunnel: Basics | Basics]] | <br />
[[Stunnel: Cost | Cost]] | <br />
[[Stunnel: Original | Original]]<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''Stunnel SSL Certificate and Key generation'''&lt;br&gt;'''Final Stunnel Test'''&lt;br&gt;'''Uniform Server 3.5-Apollo'''<br />
|}<br />
Before going live with your secure server it is '''imperative''' you generate a '''new certificate''' and '''public key''' for Stunnel. The process is extremely easy, first shut down both servers and follow the instructions below.<br />
<br />
== Generating a certificate ==<br />
The batch files '''mpg_create.bat''' allows you to create the private key and public key (certificate) in one go.<br />
<br />
The file is located in folder: '''&lt;nowiki&gt;*&lt;/nowiki&gt;\Uniform Server\udrive\home\admin\www\plugins\stunnel_424\bin'''<br />
<br />
# If running shut down your servers.<br />
# To start the process double click on the batch file '''mpg_create.bat'''.<br />
# First the private key is automatically created and requires no input from you.<br />
# The next phase is a Certificate Signing Request (CSR).&lt;br&gt;During this generation process you will be prompted for several pieces of information. These are the X.509 attributes of the certificate.<br />
# I have highlighted in bold the type of information you enter.<br />
<br />
<br />
{|cellpadding=&quot;4&quot; <br />
|width=&quot;20&quot;|<br />
|style=&quot;background:#f8f8f8;border:1px solid #cccccc&quot;|<br />
Country Name (2 letter code) [PL]:'''UK'''&lt;br&gt;<br />
State or Province Name (full name) [Some-State]:'''Cambridgeshire'''&lt;br&gt;<br />
Locality Name (eg, city) []:Cambridge&lt;br&gt;<br />
Organization Name (eg, company) [Stunnel Developers Ltd]:'''Mike Gleaves UniCenter'''&lt;br&gt;<br />
Organizational Unit Name (eg, section) []:'''Uniform Server 3.5-Apollo example'''&lt;br&gt;<br />
Common Name (FQDN of your server) [127.0.0.1]:'''fred.gotdns.com'''&lt;br&gt;<br />
Press any key to continue<br />
|}<br />
<br />
<br />
You can repeat this process at any time, '''have a play''' and get a feel for what’s going on. The information you enter is unimportant with the exception of '''FQDN''' (fully qualified domain name) if you have one use it (its the full address you would enter in a browser apart from the http:// bit).<br />
<br />
'''''Note 1''''': A default value is displayed in square brackets press return to accept this value. If you are feeling lazy press return at each prompt. The resulting certificate is fully functional however it does not look very professional when displayed in a browser.<br />
<br />
'''''Note 2''''': '''The only thing of importance each certificate you generate is unique'''.<br />
<br />
It really is that easy to produce a self signed certificate to secure your personal server. If you want some background information take a look at this page SSL basics.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Ports ==<br />
<br />
'''Port 80'''<br />
<br />
This is the standard port for unsecured web page servers, Uniform Server (Apache) defaults to this. If you have changed this default setting you need to change Stunnel’s configuration file to match your new port.<br />
<br />
'''Port 443'''<br />
<br />
This is the standard port for secure web page servers and Stunnel’s default setting. If you need to use a different port change Stunnel’s configuration file as required.<br />
<br />
'''Internet access'''<br />
<br />
When you put your servers (Apache and Stunnel) online you must have ports '''80''' and '''443 open''' for public access otherwise your servers will be inaccessible. Make sure your firewall does not block these ports. In addition if you are using a wireless router (or other router) remember to forward both ports 80 and 443.<br />
<br />
'''''Note''''': If you have changed the ports use these values instead.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Help ==<br />
I have purposely avoided showing how to set the ports on your firewall or router. The reason being each firewall and router use different methods; however do not be discouraged there is a complete site dedicated to this [http://portforward.com/&quot; portforward.com].<br />
<br />
I your firewall or router is not listed on this site then it does not exist, yes it’s that comprehensive. Start from this [http://portforward.com/guides.htm guides page].<br />
<br />
'''''[[#top | Top]]'''''<br />
== Not sure – Port bashing ==<br />
You have opened your server ports or have you? Now would be a good time to check that you were successful. This next site is a must visit Gibson Research its where you can get a free bashing or more acutely port probing.<br />
<br />
Towards the end of this page click the link ShieldsUP, at the bottom of this new page click precede which takes you to the main ShieldsUP page. (You need to follow the links in the above that’s the way it works). Once you have navigated to the page you will find this control panel:<br />
<br />
[[Image:Uc_shieldsup.gif]]<br />
<br />
To perform a full port scan (probe) click the '''All Service Ports''' link. When the test completes you will see two '''red squares''' one for each port (80 and 443) indicating your servers are accessible. Do not be alarmed by the fail message you opened these ports however if you see any other ports open its probably wise to check these out.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Fully secure server ==<br />
Your web site is public on '''both''' the secure (port 443) and insecure (port 80) ports. This means users can access your pages using either a secured or unsecured connection. You may only want access via the secure port, to achieve this either block incoming port 80 in your firewall or disable port forwarding for port 80 in you router.<br />
<br />
Confirm you have correctly disabled port 80 by repeating the port probe at Gibson Research.<br />
<br />
== Conclusion ==<br />
I have shown how easy it is to use Stunnel for a '''personal secure server'''. If you need more detail check out the additional pages [[Stunnel: Resolved | Resolved]], [[Stunnel: Basics | Stunnel Basics]] and [[Stunnel: Original | Stunnel Original write-up]] these I separated out for clarity.<br />
<br />
Perhaps you do not wish to secure your entire server but only a single virtual host. I have had several requests how to-do this which I cover on the next page [[Stunnel: Single Vhost | Securing a Single Vhost]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Application]]<br />
[[Category: Development]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_Portable_-_Authentication&diff=4894Mini Servers: Apache 2.2.9 Portable - Authentication2010-11-24T10:24:56Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ujybyqum.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ujybyqum.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Uc nav mini servers}}<br />
[[Image:Uc_mini_1a.gif|Apache 2.2.9 Portable - Authentication|right]]'''Mini Server 3 using Apache 2.2.9 Core'''<br />
<br />
This mini server uses mini-server 1 as a starting point it shows how to increase this basic servers functionality. Being a demo server I have moved it to port '''8083'''. Each additional piece of functionality is independent however where there are module dependencies I have highlighted these.<br />
<br />
The following shows how to enable '''.htaccess''', basic '''authentication''' and '''mod rewrite'''. Mod rewrite is used to enhance basic authentication.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Moving the Server ==<br />
If you need to run the server on a different port or virtual drive this is straight forward:<br />
<br />
=== Change virtual drive ===<br />
The server automatically detects the first free drive letter and uses that to run the server on.<br />
You can override this in one of two ways:<br />
<br />
# Start the server using a drive parameter for example: '''server_start.bat z''' this forces the server to use drive z<br />
# Edit server_start.bat, locate the following line:&lt;br&gt;&amp;nbsp;&amp;nbsp;'''rem set Disk=w''' &lt;br&gt;Remove the rem and replace w with the letter you want to use for example:&lt;br&gt;&amp;nbsp;&amp;nbsp;'''set Disk=x'''&amp;nbsp; Forces the server to use drive letter x<br />
<br />
=== Change server default port ===<br />
<br />
* Edit '''httpd.conf''' located in folder *\udrive\usr\local\apache2\conf locate these lines:<br />
:* Listen 8083<br />
:* ServerName localhost:8083<br />
:Change them as follows:<br />
:* Listen 8080 <br />
:* ServerName localhost:8080<br />
<br />
To access the server type '''&lt;nowiki&gt;http://localhost:8080/&lt;/nowiki&gt;''' into your browser address bar.<br />
<br />
If port already in use try any value above 2000<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== How to enable htaccess ==<br />
Apache uses additional configuration files these either override or add directives to the main configuration. Any changes made in these files unlike '''httpd.conf''' do not require a server re-start. <br />
<br />
Add the directive '''AllowOverride All''' to the root folder. This directive means all Apache directives can be overridden or added. <br />
&lt;pre&gt;<br />
&lt;Directory &quot;/www&quot;&gt; <br />
AllowOverride All<br />
Order allow,deny <br />
Allow from all <br />
&lt;/Directory&gt; <br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' I have not added this directive to the main directory because putting it in the web root gives a slight speed advantage.<br />
<br />
'''File name:'''<br />
<br />
Apache needs to know the file name of the designated additional configuration file. The name can be anything thing you like however by tradition its named '''.htacces''' its a good idea to stick with this. The directive to add the file name is '''AccessFileName .htaccess'''.<br />
<br />
This file along with a similarly named password file shall not be viewable to restrict Internet user access add the following file restrictions. <br />
&lt;pre&gt;<br />
AccessFileName .htaccess<br />
<br />
&lt;Files ~ &quot;^\.ht&quot;&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Files&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' The password file will not be accessible since it is located outside of the root folder www. In this situation the above code is belt and braces however third party scripts may be using password files within the root folder hence keep the code as is.<br />
<br />
That's all there is to enabling htaccess files, before you can use them the server must be restarted to pick up the new main configuration file. At this stage if you place either authentication or mode rewrite directives in the htaccess file andrun the server it will cause Apache to spit out misconfiguration errors. To use these directives the appropriate modules must be included in the main configuration file httpd.conf these are covered in the following sections. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== How to add authentication ==<br />
Basic authentication is dependent on three modules add the following directives to the modules section in httpd.conf.<br />
<br />
&lt;pre&gt;<br />
LoadModule auth_basic_module modules/mod_auth_basic.so<br />
LoadModule authn_file_module modules/mod_authn_file.so<br />
LoadModule authz_user_module modules/mod_authz_user.so<br />
&lt;/pre&gt;<br />
<br />
The directives on their own are of little use unless you copy the three modules to folder *\udrive\usr\local\apache2\modules hence the reason for downloading a [[Mini Servers: Support and download#Apache| full copy of Apache]] allows you to pick the modules you require. <br />
<br />
'''''Note'':''' After adding modules always restart the server otherwise Apache will not be able to pick up the new configuration.. <br />
<br />
'''''[[#top | Top]]''''' <br />
=== Add password folder ===<br />
Basic authentication uses '''name''' and '''password''' pairs these are stored in a text file named '''.htpasswd''' however you can use any name you like again convention dictates '''.htpasswd''' hence best to use that.<br />
<br />
For security this file must be located outside of the server web root (folder www). Uniform server uses the following folder:<br />
<br />
* '''&lt;nowiki&gt;*&lt;/nowiki&gt;\udrive\htpasswd\www'''<br />
<br />
You can change this to suite your own requirements I will stick with this only because it keeps commoality between the mini servers and Uniform Server 3.5-Apollo.<br />
<br />
Edit the file '''.htpasswd''' and add the following name:password pair:<br />
&lt;pre&gt;<br />
root:root<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' Name may include spaces the password shall be something long and random e.g:<br />
* '''John Smith:x5Wl8df6a29'''<br />
* '''Mike:Qn67sG8k2'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== htaccess file ===<br />
Before we can test copy an .htaccess file to folder www the one from Uniform Server will do.<br />
<br />
Edit the file to look like this:<br />
&lt;pre&gt;<br />
AuthName &quot;Uniform Server - Server Access&quot;<br />
AuthType Basic<br />
AuthUserFile /htpasswd/www/.htpasswd<br />
Require valid-user<br />
&lt;/pre&gt;<br />
<br />
Note: '''AuthName''' the text between quotes will be displayed in the browser popup box<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Testing ===<br />
Testing is straight forward restart the server and type '''&lt;nowiki&gt;http:/localhost:8083/&lt;/nowiki&gt;''' into your browsers address bar.<br />
<br />
You will be challenged for a name and password enter '''root''' and '''root''' to display the index page.<br />
<br />
Before moving onto mod rewrite edit the .htacces file to look like<br />
&lt;pre&gt;<br />
#AuthName &quot;Uniform Server - Server Access&quot;<br />
#AuthType Basic<br />
#AuthUserFile /htpasswd/www/.htpasswd<br />
#Require valid-user<br />
&lt;/pre&gt;<br />
<br />
with the lines commented out authentication is disabled.<br />
<br />
Alternatively delete the file its not required since we are going to protect specific folders. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== How to add mod rewrite ==<br />
Mod rewrite has no dependencies add the following line to the modules section in httpd.conf.<br />
&lt;pre&gt;<br />
LoadModule rewrite_module modules/mod_rewrite.so<br />
&lt;/pre&gt;<br />
<br />
The directive instructs Apache to load mod rewrite when the server is restarted. Remember to copy the module '''mod_rewrite.so''' from the full download into folder *\udrive\usr\local\apache2\modules. Mod rewrite is extremely powerful and weights in at only 57K.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Mini server httpd.conf ==<br />
Our complete configuration file is shown below some modules are inter dependent because of this their order is important.<br />
<br />
'''''Tip'':''' When adding modules check the downloaded full package httpd.conf configuration file it lists the correct order for all modules. <br />
&lt;pre&gt;<br />
# ================================================= <br />
# Modules <br />
# =================================================<br />
LoadModule auth_basic_module modules/mod_auth_basic.so<br />
LoadModule authn_file_module modules/mod_authn_file.so<br />
LoadModule authz_user_module modules/mod_authz_user.so<br />
<br />
LoadModule authz_host_module modules/mod_authz_host.so<br />
LoadModule dir_module modules/mod_dir.so<br />
LoadModule log_config_module modules/mod_log_config.so<br />
LoadModule mime_module modules/mod_mime.so<br />
<br />
LoadModule rewrite_module modules/mod_rewrite.so<br />
<br />
# ================================================= <br />
# Basic settings <br />
# ================================================= <br />
Listen 8083 <br />
ServerName localhost:8083<br />
ServerAdmin fred@www.somedomain.com <br />
UseCanonicalName Off <br />
ServerSignature Off <br />
HostnameLookups Off <br />
ServerTokens Prod <br />
ServerRoot &quot;/usr/local/apache2&quot;<br />
DocumentRoot &quot;/www&quot; <br />
PidFile /usr/local/apache2/logs/httpd.pid <br />
&lt;IfModule mod_dir.c&gt; <br />
DirectoryIndex index.html index.htm<br />
&lt;/IfModule&gt; <br />
<br />
# ================================================= <br />
# HTTP and performance settings <br />
# ================================================= <br />
Timeout 300 <br />
KeepAlive On <br />
MaxKeepAliveRequests 100 <br />
KeepAliveTimeout 15 <br />
&lt;IfModule mpm_winnt.c&gt;<br />
ThreadsPerChild 64<br />
MaxRequestsPerChild 0<br />
&lt;/IfModule&gt;<br />
<br />
# ================================================= <br />
# Access control <br />
# ================================================= <br />
&lt;Directory /&gt;<br />
Options None <br />
AllowOverride None <br />
Order deny,allow <br />
Deny from all <br />
&lt;/Directory&gt; <br />
<br />
&lt;Directory &quot;/www&quot;&gt; <br />
AllowOverride All<br />
Order allow,deny <br />
Allow from all <br />
&lt;/Directory&gt; <br />
<br />
AccessFileName .htaccess<br />
# The following lines prevent .htaccess and .htpasswd<br />
# files from being viewed by Web clients.<br />
<br />
&lt;Files ~ &quot;^\.ht&quot;&gt;<br />
Order allow,deny<br />
Deny from all<br />
&lt;/Files&gt;<br />
# ================================================= <br />
# MIME encoding <br />
# ================================================= <br />
DefaultType text/plain <br />
TypesConfig /usr/local/apache2/conf/mime.types <br />
<br />
# ================================================= <br />
# Logs: debug, info, notice, warn, error, crit<br />
# ================================================= <br />
LogLevel warn <br />
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined <br />
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b&quot; common <br />
LogFormat &quot;%{Referer}i -&gt; %U&quot; referer <br />
LogFormat &quot;%{User-agent}i&quot; agent <br />
ErrorLog &quot;logs/error_log&quot; <br />
CustomLog &quot;logs/access.log&quot; combined<br />
# ================================================= <br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Support files ==<br />
Each mini server is complete and zipped into a single self-extracting archive file.<br />
<br />
=== Download ===<br />
Download this server from SourceForge [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=275691 Project Page] save the file '''mini_server_3.exe''' to any folder of your choice.<br />
<br />
'''''Note'':''' Check out the mini server's [[Mini Servers: Support and download|support and download page]] detailing how to obtain full binaries for Apache, PHP and Perl.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Extract files ===<br />
Double click on mini_server_3.exe, starts the extraction process. No need to change the folder destination, click extract, this creates a new folder '''mini_server_3''' containing two files and one folder.<br />
<br />
# '''server_start.bat''' - Double click to start the server<br />
# '''server_stop.bat''' - Double click to stop server<br />
# '''udrive''' - Folder containing server and your web site.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
Testing is straight forward.<br />
<br />
# Start the server by double clicking on '''server_start.bat''' (automatically detects free drive letter creates new virtual drive and runs the server.) <br />
# Start a web browser.<br />
# Type '''&lt;nowiki&gt;http://localhost:8083/&lt;/nowiki&gt;''' into the browser address bar.<br />
# An index page is displayed, check out the secure areas by clicking links '''secure1''' or''' secure2'''.<br />
# Stop the server by double clicking on '''server_stop.bat'''<br />
<br />
'''''Note 1'':''' If you need to change the server port from '''8083''' edit httpd.conf accordingly..<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Authentication ==<br />
I have added two examples to demonstrate the use of htaccess files to protect folders using basic authentication which in turn are enhanced by mod rewrite. A full write-up of this concept can be found on this page [[Basic authentication and redirection|Basic authentication and redirection]] <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Secure1 ===<br />
From the main index page click on the '''secure1''' link. This takes you to a protected folder where you will be challenged for a name and password. Enter one of the name/password pairs shown, you will be able to view a single personal page. Each page contain cross links to other personal pages see what happens when you click one of these links.<br />
<br />
''Note'': To re-log in you must restart your browser.<br />
<br />
Folder '''secure1''' is protected by the the following .htaccess file:<br />
<br />
&lt;pre&gt;<br />
AuthName &quot;To give you a clue the following are the name:password pairs: John:21,<br />
Dave Smith:22 and Mike:23 these will take you to the private pages.&quot;<br />
AuthType Basic<br />
AuthUserFile /htpasswd/www/.htpasswd<br />
Require valid-user<br />
<br />
Options +FollowSymLinks<br />
#Options +Indexes<br />
RewriteEngine On<br />
RewriteBase /<br />
<br />
RewriteCond $1 !^John\.html<br />
RewriteCond %{REMOTE_user} ^John$<br />
RewriteRule (.*) /secure/John.html [R,L]<br />
<br />
RewriteCond $1 !^Dave\.html<br />
RewriteCond %{REMOTE_user} ^Dave\ Smith$<br />
RewriteRule (.*) /secure/Dave.html [R,L]<br />
<br />
RewriteCond $1 !^Mike\.html<br />
RewriteCond %{REMOTE_user} ^Mike$<br />
RewriteRule (.*) /secure/Mike.html [R,L]<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' Make sure to change the line '''AuthName''' to something like &quot;Please login to your secure page&quot; I included name/password pairs to make it easier to test. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Secure2 ===<br />
From the main index page click on the '''secure2''' link. This takes you to a protected folder where you will be challenged for a name and password. Enter one of the name/password pairs shown, you will be able to view the contents of a personal folder. Each personal index page contain cross links to other personal folders see what happens when you click one of these links.<br />
<br />
''Note'': To re-log in you must restart your browser.<br />
<br />
Folder '''secure2''' is protected by the the following htaccess file:<br />
<br />
&lt;pre&gt;<br />
AuthName &quot;To give you a clue the following are the name:password pairs: Jane:41,<br />
Dawn:42 and Ruth Smith:43 these will take you to the private folders.&quot;<br />
AuthType Basic<br />
AuthUserFile /htpasswd/www/.htpasswd<br />
Require valid-user<br />
<br />
Options +FollowSymLinks<br />
RewriteEngine On<br />
RewriteBase /<br />
<br />
RewriteEngine on<br />
RewriteCond $1 !^mpg1/<br />
RewriteCond %{REMOTE_user} ^Jane$<br />
RewriteRule ^(.*) secure2/mpg1/$1 [R,L]<br />
<br />
RewriteCond $1 !^mpg2/<br />
RewriteCond %{REMOTE_user} ^Dawn$<br />
RewriteRule ^(.*) secure2/mpg2/$1 [R,L]<br />
<br />
RewriteCond $1 !^mpg3/<br />
RewriteCond %{REMOTE_user} ^Ruth\ Smith$<br />
RewriteRule ^(.*) secure2/mpg3/$1 [R,L]<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' Make sure to change the line '''AuthName''' to something like &quot;Please login to your secure folder&quot; I included name/password pairs to make it easier to test. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Multi Servers ==<br />
If you wish to run several mini servers at the same time create a new folder for each server and copy folder mini_server_3 into each of these.<br />
<br />
Change the server port for each server to be unique. The servers may be started in any order.<br />
<br />
'''''Note'':''' You can run the mini servers alongside Uniform Server 3.5-Apollo however you must start Uniform Server first.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
These mini-servers are indented to show you how to build in functionality as and when required, primarily to remove bloat and increase security. You now have a basic server with the capability of of mod rewrite and basic authentication to protect individual folders.<br />
<br />
The real problem with this protection it is not secure, name/password pairs including pages are sent unencrypted. This plain text can easily be intercepted exposing your passwords. The next server ([[Mini Servers: Apache 2.2.9 Portable - Authentication SSL|Mini Server 4]]) in this series addresses this major issue by adding '''SSL'''. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Mini Servers]]<br />
[[Category: Oily Rag]]<br />
[[Category: Self Install]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=User:Ric&diff=4888User:Ric2010-11-24T10:24:18Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ocilufic.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ocilufic.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{|width=&quot;100%&quot;<br />
|-<br />
|<br />
&lt;div style=&quot;position:relative; top:-12px;background:#cccccc;border:4px solid #666666&quot;&gt;<br />
&lt;div style=&quot;height:8px;background:#cccccc&quot;&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;div align=&quot;center&quot; style=&quot;background:#cccccc;&gt;<br />
{|border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background:#cccccc&quot;<br />
|-<br />
|valign=&quot;top&quot; width=&quot;1&quot;|<br />
&lt;div style=&quot;position:absolute;height:134px;width:760px;&quot;&gt;<br />
&lt;div align=&quot;center&quot;&gt;<br />
{|border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;370&quot; style=&quot;background:#cccccc&quot;<br />
|-<br />
|width=&quot;1&quot;|&lt;div style=&quot;width:1px;height:115px;background:#cccccc&quot;&gt;&lt;/div&gt;<br />
|&lt;div style=&quot;text-align:center;margin:0;padding:0;border:1px solid #000000;background:#dfdfdf&quot;&gt;<br />
'''''Name'': Mike Gleaves&lt;br&gt;''Location'': Cambridge England UK'''<br />
&lt;/div&gt;<br />
|}<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
|[[Image:Uc_mpg_logo_left.gif ]]<br />
|[[Image:Uc_logo_a1.gif ]]<br />
|[[Image:Uc_mpg_logo_right.gif ]]<br />
|}<br />
&lt;div style=&quot;height:4px;background:#cccccc&quot;&gt;&amp;nbsp;&lt;/div&gt;<br />
{|width=&quot;760&quot; cellpadding=&quot;6&quot; style=&quot;background:#dfdfdf;border:1px solid #888888;margin-top:0px&quot;<br />
|-<br />
|align=&quot;left&quot; |<br />
{| style=&quot;background:#cccccc&quot;<br />
|-<br />
|align=&quot;left&quot; |<br />
'''''A quick thank you'''''<br />
<br />
''I would like to express my sincerest thanks to the Uniform Server team for hosting this site. They have imposed no restrictions or censorship hence the views and opinions expressed on this site are my personal ones and do not reflect those of the Uniform Server team in any way. I will endeavour to be unbiased and be critical may even upset the design team. (Mike Gleaves 21-6-2006)''<br />
|}<br />
Well that banner has been on UniCenter for so long and the sentiments remain true. I have been asked several times why I do not publish on Uniform Server’s Wiki? The answer is simple, if the site were ever pulled I would have just published it somewhere else.<br />
<br />
After nearly two years the site has grown out of control and becoming difficult to manage. The lack of a search facility has become a hindrance hence I have conceded and decided to publish new material on the Wiki.<br />
<br />
'''What will be moved'''<br />
<br />
Some of the older material where appropriate I will move over and update. Uniform Server 3.5-Apollo will be given priority it’s a large commitment and will take time.<br />
<br />
'''Learning'''<br />
<br />
I am still learning how to use this Wiki and what limitations it imposes, discovered while updating this page CSS background images are not allowed. Most restrictions are imposed because of potential security issues a Wiki by its nature is open with the majority of pages being editable by Wiki members. Open access precludes running Java scripts and raw HTML hence some of UniCenter's pages are not directly transferable. Its not a major problem just means a few modifications will be required.<br />
<br />
----<br />
<br />
'''Security'''<br />
<br />
Most of my write-ups include downloadable examples to accommodate this practice on the Wiki Olajide has provided a secure download area. Downloadable files are mostly 7Z self-extracting archive files, pages that provide a download link include a corresponding MD5 check-sum these pages are editable only by WikiSysop’s. Make sure a file downloaded matches its MD5 I use '''winMd5Sum Portable''' from [http://portableapps.com/apps/utilities/winmd5sum_portable Portable Apps]. <br />
<br />
Please note I do my best to make sure any downloads do not contain malicious content or viruses however run these downloads at your own risk. Do not be complacent regarding security run downloaded files through a virus scanner and make sure corresponding check-sum matches. Report any security issues or problems immediately so they can be quickly addressed.<br />
<br />
All the best Mike Gleaves&lt;br&gt; <br />
(Forum &amp; Wiki - Ric)<br />
&lt;/div&gt;<br />
&lt;div style=&quot;height:40px;background:#dfdfdf&quot;&gt;&amp;nbsp;&lt;/div&gt;<br />
|}<br />
&lt;div style=&quot;height:8px;background:#cccccc&quot;&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;/div&gt;<br />
|}<br />
<br />
&lt;div align=&quot;center&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
&lt;/div&gt;</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_MySQL_4.1.22_Service&diff=4887Mini Servers: MySQL 4.1.22 Service2010-11-24T10:23:57Z<p>Upazixorys: </p>
<hr />
<div>=[http://ewefobyme.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc nav mini servers}}<br />
[[Image:Uc_mini_14.gif|MySQL 4.1.22|right]]'''Mini Server 12 MySQL 4.1.22-community-nt Core'''<br />
<br />
This page covers running our mini server (describe on the [[Mini Servers: MySQL 4.1.22 Portable|previous page]]) as a service, its big brother Uniform Server 3.5-Apollo automates this process. We are not going to take this easy option! Well you would never learn anything by doing that, the manual alternative although slightly more difficult provides an insight into MySQL and Uniform Servers flexibility.<br />
<br />
Note: Check[[#Support files | support section for download]] details<br />
<br />
'''''[[#top | Top]]'''''<br />
== Specification ==<br />
The server has the following specification:<br />
<br />
* Server shall run as a service and include a service name<br />
* MySQL server shall run on port 3314 with the option of changing this to a different port.<br />
* Server clients mysqladmin.exe and mysql.exe shall be included. <br />
<br />
The only difference in this specification server is no longer portable but run as a service. This means every time you restart your PC the MySQL server will automatically start. The advantage of this, when running a server permanently connected to the Internet should a power interruption occur the server will automatically restart when power is restored. If other elements of the system have been set accordingly then your Internet presence will also be restored.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Security Issues ==<br />
Security issues remain as explained on the previous page. I would like to stress this is about as best as it gets. The server is restricted to localhost access with a single user (root) requiring a password.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Changes ==<br />
Interestingly if you run the portable version of this sever on a dedicated disk the configuration file would remain unchanged. Use the two new batch files and you are ready to go.<br />
<br />
The server is being run from a folder and the relative paths within my.cnf require converting to absolute paths.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Relative ===<br />
In theory MySQL is quite happy to use relative paths for example '''“/”''' refers to the top level of the current disk. Uniform Server and our portable mini server use this to great advantage by defining a dedicated virtual disk '''“w”'''. However when changing across disk space Windows gets uptight about relative paths unless you can explicitly define a disk.<br />
<br />
=== Absolute ===<br />
Windows likes pegs hammered into the ground so to speak, hence when running as a service specifying absolute paths is essential to keep both parties happy for example '''c:\mini_server_14''', the drive must be specified and then any folders etc.<br />
<br />
No need to ramble on, just remember absolute paths are the order of the day so lets roll up ours sleeves and look at some code hacking.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Configuring MySQL ==<br />
As mentioned above absolute paths are required in the configuration file. I have chosen to run the server on '''C''' drive from folder '''mini_server_14''' you can use a different drive and or folder the choice is yours, just substitute accordingly. I have shown only the section that needs changing.<br />
<br />
'''Original:''' <br />
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
!my.cnf located in folder: C:\mini_server_14\bin<br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
&lt;pre style=&quot;border:none;background:#f5f5f5;margin:0;padding:6&quot;&gt;<br />
# Uncomment the following rows if you move the MySQL distribution to another<br />
# location<br />
basedir = &quot;/&quot;<br />
datadir = &quot;/data/&quot;<br />
tmpdir = &quot;/tmp&quot;<br />
&lt;/pre&gt;<br />
|}<br />
'''Change to:'''<br />
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
!my.cnf located in folder: C:\mini_server_14\bin<br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
&lt;pre style=&quot;border:none;background:#f5f5f5;margin:0;padding:6&quot;&gt;<br />
# Uncomment the following rows if you move the MySQL distribution to another<br />
# location<br />
basedir = &quot;c:/mini_server_14/&quot;<br />
datadir = &quot;c:/mini_server_14/data/&quot;<br />
tmpdir = &quot;c:/mini_server_14/tmp/&quot;<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== install.bat ==<br />
Batch files to install and uninstall MySQL as a service are not very complex; the trick is to supply the right parameters as shown.<br />
<br />
The first line installs MySQL as a service if you run more than one copy of MySQL it requires a unique name for this server I am using '''mini_server_14'''. What is important --defaults-file=C:/mini_server_14/bin/my.cnf this forces MySQL to pick-up the correct configuration file. <br />
<br />
The second line starts the service notice it uses the unique name defined in the first line. <br />
<br />
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
!install.bat located in folder: C:\mini_server_14<br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&gt;<br />
C:\mini_server_14\bin\mysqld-opt.exe --install mini_server_14 --defaults-file=C:/mini_server_14/bin/my.cnf<br />
net start mini_server_14<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== uninstall.bat ==<br />
The uninstall batch file first stops the “MySQL” service and then proceeds to uninstall it. Note the use of the service name '''mini_server_14'''.<br />
<br />
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
!uninstall.bat located in folder: C:\mini_server_14<br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&gt;<br />
net stop mini_server_14<br />
bin\mysqld-opt.exe --remove mini_server_14<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== console.bat ==<br />
This batch file provides a convenient way to start a command window at the right location to run MySQL clients. It displays a quick start guide for reference.<br />
<br />
{|border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#222222&quot;<br />
|-style=&quot;background:#e8e8e8&quot;<br />
!console.bat located in folder: C:\mini_server_14<br />
|-style=&quot;background:#f5f5f5&quot;<br />
|<br />
&lt;pre style=&quot;border:none;padding:0;margin:0&quot;&gt;<br />
cd bin<br />
start cmd.exe /k type quick_start_guide.txt<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Command Line ==<br />
After installing the MySQL service with the above batch file you can start and stop the &quot;MySQL&quot; service at anytime using a command line this saves uninstalling the service every time you want to stop the server:<br />
<br />
* '''net stop mini_server_14'''<br />
* '''net start mini_server_14'''<br />
<br />
Note: You can use console.bat to open a command window. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Support files ==<br />
Each mini server is complete and zipped into a single self-extracting archive file.<br />
<br />
=== Download ===<br />
Download this server from SourceForge [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=275691 Project Page] save the file '''mini_server_14.exe''' to drive '''C'''.<br />
<br />
'''''Note'':''' Check out the mini server's [[Mini Servers: Support and download|support and download page]] detailing how to obtain full binaries for MySQL.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Extract files ===<br />
Double click on mini_server_14.exe, starts the extraction process. No need to change the folder destination, click extract, this creates a new folder '''mini_server_14''' containing five files and five folders.<br />
<br />
''Files:''<br />
# '''install.bat''' - Double click to install and start server as a service.<br />
# '''uninstall.bat''' - Double click to stop and uninstall server service.<br />
# '''console.bat''' - Double click to open a command window displays a quick quide.<br />
# '''my.cnf''' - MySQL server configuration file.<br />
# '''readme.txt''' - Provides a summary how to change aspects of the server.<br />
<br />
''Folders:''<br />
# '''bin''' - Contains the MySQL program and MySQL clients.<br />
# '''data''' - Contains MySQL database and is the destination for user databases.<br />
# '''doc''' - Contains Uniform Server license.<br />
# '''share''' - Contains character sets and language files.<br />
# '''tmp''' - Folder used for temporary files.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
Testing is straight forward.<br />
<br />
# Install the server by double clicking on '''install.bat'''<br />
# Run console.bat this opens a command window.<br />
# In the command window type the following:&lt;br&gt;'''mysqladmin --port=3314 --user=root --password=root status'''&lt;br&gt;If challenged by your firewall allow access for mysqladmin.exe<br />
<br />
Result similar to this confirms server is running:<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root status<br />
Uptime: 72 Threads: 1 Questions: 1 Slow queries: 0 Opens: 12<br />
Flush tables: 1 Open tables: 3 Queries per second avg: 0.014<br />
<br />
C:\mini_server_14\bin&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Change drive letter and or folder ==<br />
The server requires a fixed location currently: c:\mini_server_14<br />
<br />
You can move the server to any drive and folder for example e:\my_server\mini_server_14 <br />
<br />
To do this you need to edit three files:<br />
* '''install.bat'''<br />
*''' uninstall.bat'''<br />
* '''my.cnf'''<br />
<br />
Find all occurrences of '''c:\mini_server_14''' and replace with '''e:\my_server\mini_server_14'''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Change server default port ==<br />
Mini MySQL uses a non-standard port 3314 this avoids clashing with Uniform Server which uses the standard port 3306 for it's MySQL server. If you are not running another server on 3306 you can use this port.<br />
<br />
You can run any number of MySQL servers so long as each server's port is unique and it's service name. To change a server's port edit '''my.cnf'''. The following example shows how to change the port to 3307:<br />
<br />
At the top of the file you will find there are two port lines these need changing locate this section:<br />
&lt;pre&gt;<br />
# This will be passed to all mysql clients<br />
[client]<br />
#password=my_password<br />
port=3314<br />
#socket=MySQL<br />
<br />
# Here is entries for some specific programs<br />
# The following values assume you have at least 32M ram<br />
<br />
# The MySQL server<br />
[mysqld]<br />
<br />
port=3314<br />
#socket=MySQL<br />
&lt;/pre&gt;<br />
and change as shown:<br />
<br />
&lt;pre&gt;<br />
# This will be passed to all mysql clients<br />
[client]<br />
#password=my_password<br />
port=3307<br />
#socket=MySQL<br />
<br />
# Here is entries for some specific programs<br />
# The following values assume you have at least 32M ram<br />
<br />
# The MySQL server<br />
[mysqld]<br />
<br />
port=3307<br />
#socket=MySQL<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Change Service Name ==<br />
To change the service name two files require editing:<br />
<br />
Edit instal.bat locate the name mini_server_14 and change to something unique for example mini_server_14xx<br />
<br />
Edit uninstal.bat locate the name mini_server_14 and change to something unique for example mini_server_14xx<br />
<br />
'''''[[#top | Top]]'''''<br />
== Multi Servers ==<br />
If you wish to run several mini servers at the same time create a new folder for each server and copy contents of folder mini_server_14 into each of these.<br />
<br />
Change the paths, server port and service name as explained above, each server must be unique. The servers may be started in any order.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Additional information ==<br />
The following assumes you have a command window open if not run '''console.bat'''. This section is intended to provide a few general examples and how to run them on server 12. <br />
<br />
=== MySQL - Admin ===<br />
The mysqladmin utility is a interactive client program allowing you to connect to a MySQL server and perform configuration tasks. <br />
<br />
View all commands supported by mysqladmin type the following at a command prompt: '''mysqladmin --help'''<br />
<br />
One such command is '''status''' this allows you to perform a quick check to see if the server is running.<br />
<br />
Type: '''mysqladmin --port=3314 --user=root --password=root status'''<br />
<br />
''Command line details:''<br />
<br />
*'''mysqladmin''' Runs the program with the following parameters<br />
*'''--port=3314''' Ensures the correct server is picked-up<br />
* '''--user=root''' The user will normally be the server administrator, in this example name is root. <br />
* '''--password=root''' User password in this example root. Note if you type only '''--password''' you will be prompted to enter a password<br />
* '''status''' Follow password with a command to be executed on the server, in this example server '''status''' is being requested.<br />
<br />
Note: I am using what is referred to as long format parameters '''--something=something''' you can use short versions (not covered)<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Change Root password ====<br />
<br />
'''Server upgrade:''' If you upgrade the MySQL server it's default is to have no password set, in this situation use the following to set a password: <br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root password NEWPASSWORD<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' ''password'' before NEWPASSWORD is a command. <br />
<br />
'''Mini Server downloaded:''' Mini Server 4a has both user name and password set to root. To change an existing password use the following:<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root password NEWPASSWORD<br />
&lt;/pre&gt;<br />
<br />
For example to change the root password to fred123<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=root password fred123<br />
&lt;/pre&gt;<br />
To re-log in use the new password for example:<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=root --password=fred123 status<br />
Uptime: 571 Threads: 1 Questions: 6 Slow queries: 0 Opens: 13 Flush tables: 1 Open tables: 4 Queries per second a<br />
vg: 0.011<br />
&lt;/pre&gt;<br />
<br />
==== Change password for other users ====<br />
To change a normal user's password you follow a similar process for example user mike, old password fred123 and new password power26:<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysqladmin --port=3314 --user=mike --password=fred123 password power26<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== MySQL - Client program===<br />
The '''mysql''' client program (terminal monitor, monitor or mysql prompt) is an interactive program allowing you to connect to a MySQL server, run queries, and view the results.<br />
<br />
It may also be used in batch mode, you place your queries in a file beforehand, then tell mysql to execute the contents of the file.<br />
<br />
The program is run from a command prompt you need to navigate to the '''bin folder''' in order to run it see '''[[#DOS prompt|DOS prompt section]]''' for details.<br />
<br />
To view all commands supported by '''mysql''' type the following: '''mysql --help'''<br />
<br />
'''Log into Mini Server 14'''<br />
<br />
To log into a mini server type the following: '''mysql --port=3314 --user=root --password=root''' on success a mysql prompt '''mysql&gt;''' is displayed this is where you type in '''sql''' commands.<br />
<br />
The following example logs into and then out of the server. At the mysql prompt I have typed '''quit''' this terminate the program logs out of the server. <br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
Welcome to the MySQL monitor. Commands end with ; or \g.<br />
Your MySQL connection id is 2 to server version: 4.1.22-community-nt<br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br />
mysql&gt; quit<br />
Bye<br />
C:\mini_server_14\bin&gt;<br />
&lt;/pre&gt;<br />
<br />
'''Quick Example:'''<br />
<br />
The following shows a complete session:<br />
<br />
'''''Commands used'':'''<br />
<br />
mysql --port=3314 --user=root --password=root&lt;br&gt;<br />
SELECT VERSION(), CURRENT_DATE;&lt;br&gt;<br />
SHOW DATABASES;&lt;br&gt;<br />
quit<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
Welcome to the MySQL monitor. Commands end with ; or \g.<br />
Your MySQL connection id is 5 to server version: 4.1.22-community-nt<br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br />
<br />
mysql&gt; SELECT VERSION(), CURRENT_DATE;<br />
+---------------------+--------------+<br />
| VERSION() | CURRENT_DATE |<br />
+---------------------+--------------+<br />
| 4.1.22-community-nt | 2008-08-13 |<br />
+---------------------+--------------+<br />
1 row in set (0.01 sec)<br />
<br />
mysql&gt; SHOW DATABASES;<br />
+----------+<br />
| Database |<br />
+----------+<br />
| mysql |<br />
+----------+<br />
1 row in set (0.00 sec)<br />
<br />
mysql&gt; quit<br />
Bye<br />
<br />
C:\mini_server_14\bin&gt;<br />
&lt;/pre&gt;<br />
<br />
After running the above you will have an idea what to expect. The next examples show only the commands used, I have included the prompts '''Z:\bin&gt;''' (DOS prompt) and '''mysql&gt;''' (mysql prompt) for reference do not type these in.<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Change Root password ====<br />
MySQL stores user names and passwords in the MySQL database in table user, you can directly update both name and password.<br />
<br />
Use the following method to update or change password for user root<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
mysql&gt; USE mysql;<br />
mysql&gt; update user set password=PASSWORD(&quot;NEWPASSWORD&quot;) where User='root';<br />
mysql&gt; FLUSH PRIVILEGES;<br />
mysql&gt; quit<br />
&lt;/pre&gt;<br />
<br />
For example change the root user password to fred123 <br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
<br />
mysql&gt; USE mysql;<br />
Database changed<br />
mysql&gt; update user set password=PASSWORD(&quot;fred123&quot;) where User='root';<br />
Query OK, 0 rows affected (0.00 sec)<br />
Rows matched: 2 Changed: 0 Warnings: 0<br />
<br />
mysql&gt; FLUSH PRIVILEGES;<br />
Query OK, 0 rows affected (1.03 sec)<br />
<br />
mysql&gt; quit<br />
Bye<br />
<br />
--- Test new password ----------<br />
<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=fred123<br />
Welcome to the MySQL monitor. Commands end with ; or \g.<br />
Your MySQL connection id is 11<br />
Server version: 4.1.22-community-nt MySQL Community Edition (GPL)<br />
<br />
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br />
<br />
mysql&gt; quit<br />
Bye<br />
C:\mini_server_14\bin&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Change Root User name ====<br />
The root user does not need to be named 'root'. Most attackers will obviously try to compromise the 'root' user account and will be stopped if there is no 'root' user. To change the name of the root user account, use the following commands:<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
mysql&gt; USE mysql;<br />
mysql&gt; UPDATE user SET user='mike' WHERE user='root';<br />
mysql&gt; FLUSH PRIVILEGES;<br />
mysql&gt; quit<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Restrict root to localhost ====<br />
In addition, the root account can be restricted to login from localhost with the following commands:<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
mysql&gt; use mysql;<br />
mysql&gt; DELETE FROM user WHERE user = 'root' AND host = '%';<br />
mysql&gt; FLUSH PRIVILEGES;<br />
mysql&gt; quit<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' Like Uniform Server 3.5-Apollo the mini server already restricts access to localhost only. <br />
<br />
'''''[[#top | Top]]'''''<br />
==== Remove the anonymous account ====<br />
Most new MySQL installations contain an anonymous account for testing. To secure this remove the account using the following commands:<br />
<br />
'''''Note'':''' Shown as an example it does not exist on the mini server.<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin&gt;mysql --port=3314 --user=root --password=root<br />
mysql&gt; use mysql;<br />
mysql&gt; DELETE FROM user WHERE user = '';<br />
mysql&gt; FLUSH PRIVILEGES;<br />
mysql&gt; quit<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' The mini server does not include an anonymous account.<br />
<br />
== Summary ==<br />
That concludes this series of mini servers, although they use only core elements from Apache, MySQL, PHP and Perl they are none the less very powerful. Using Uniform Server's architecture you can pop them on a USB memory stick.<br />
<br />
Although Uniform Server 3.5-Apollo is a complete package sometimes its useful to run one of the mini servers alongside it to explore various architectures.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Mini Servers]]<br />
[[Category: MySQL]]<br />
[[Category: Oily Rag]]<br />
[[Category: Self Install]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=DtDNS:_Crude_Updater&diff=4886DtDNS: Crude Updater2010-11-24T10:23:51Z<p>Upazixorys: </p>
<hr />
<div>=[http://edojalys.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Nav DtDNS}}<br />
'''Whats a crude updater'''<br />
<br />
A crude IP updater does not apply to the mechanism of updating an IP address that’s rather sophisticated. It applies to a users ability to update an IP address even if its not required i.e. it has not changed.<br />
<br />
If you know your IP address has changed the following is a quick way to force an update at DtDNS. <br />
<br />
This method is recommended only for testing please check your IP has changed before updating otherwise you may invoke the draconian dragon that will ban your IP.<br />
<br />
== Request a page ==<br />
The mechanism as seen by an end user is neat just request a page with the following format (what you type into a browser):<br />
{|<br />
|-<br />
|&lt;pre&gt;<br />
http://&gt;www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password&amp;'''ip'''=address&amp;'''client'''=name<br />
https://www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password&amp;'''ip'''=address&amp;'''client'''=name<br />
&lt;/pre&gt;<br />
|}<br />
There really is no excuse for using the first URL since all modern browser can understand and use https.<br />
<br />
That means your password is encrypted before being sent over the Internet.<br />
<br />
Hence use this format:<br />
{|<br />
|-<br />
|&lt;pre&gt;<br />
https://www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password&amp;'''ip'''=address&amp;'''client'''=name<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
== Crude ==<br />
<br />
I mentioned crude that also applies to etiquette, would be nice to include client this is optional just like the IP address.<br />
<br />
If you don’t supply an IP address DtDNS will check your request page and determine it from that. Generally for a home web server this is adequate.<br />
<br />
The update request page reduces to this:<br />
{|<br />
|-<br />
|&lt;pre&gt;<br />
https://www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
== Practical - html page updater==<br />
If you hate typing and find it difficult to remember the format, names and passwords for five hosts a neat solution is to create an html page in folder UniServer.<br />
<br />
This example uses the Hostnames and Domains we configured on previous page.<br />
<br />
This gives the following id's:<br />
* '''uni23.dtdns.net'''<br />
* '''books.effers.com'''<br />
Lets assume the password is<br />
* '''fred123'''<br />
Create a new text file named '''ip_updater.html''' in folder '''UniServer''' with the following content:<br />
&lt;pre&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;DtDNS Ip Updater&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a href=&quot;https://www.dtdns.com/api/autodns.cfm?id=uni23.dtdns.net&amp;pw=fred123&quot; target=&quot;_blank&quot;&gt;1) Update uni23.dtdns.net&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;https://www.dtdns.com/api/autodns.cfm?id=books.effers.com&amp;pw=fred123&quot; target=&quot;_blank&quot;&gt;2) Update books.effers.com&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;https://www.dtdns.com/api/autodns.cfm?id=hostname&amp;pw=password&quot; target=&quot;_blank&quot;&gt;3) Update xxxx&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;https://www.dtdns.com/api/autodns.cfm?id=hostname&amp;pw=password&quot; target=&quot;_blank&quot;&gt;4) Update xxxx&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;https://www.dtdns.com/api/autodns.cfm?id=hostname&amp;pw=password&quot; target=&quot;_blank&quot;&gt;5) Update xxxx&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/pre&gt; <br />
Substitute your real id’s ('''hostname.domain''') and password, I have assumed you will be using all five free hosts hence included five links.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
I have referred to the above as a crude updater because it requires manually running.<br />
<br />
It’s ideal when testing server’s virtual hosts saves logging in into your DtDNS account and manually changing IP addresses.<br />
<br />
I mentioned in the introduction this method is recommended only for testing please check your IP has changed before updating. The [[DtDNS: WhatsMyIP | '''next page''']] covers how to determine your IP. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_WinBinder_2:_WinBinder_portable&diff=4885PHP WinBinder 2: WinBinder portable2010-11-24T10:23:42Z<p>Upazixorys: </p>
<hr />
<div>=[http://oqagacyti.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
{{Nav PHP WinBinder 2}}<br />
'''''WinBinder Part 2'''''<br />
== Introduction ==<br />
PHP is an excellent scripting language, primarily designed for dynamic web sites. It also contains a command line interface, which you run from a command window. Although powerful, it lacks a friendly user interface. The WinBinder project addresses this with a neat extension, allowing a user to create Windows applications.<br />
<br />
This tutorial describes a slightly modified version that is portable and runs straight out of the box. The tutorial assumes you have extracted a copy as explained on [[PHP WinBinder 2: Introduction#WinBinder Portable | '''this page''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Examples ==<br />
To really appreciate WinBinder's capabilities, run the examples in the folder C:\us_wb\wb\'''examples'''. All WinBinder Windows scripts have the extension '''phpw'''. You will notice that each script has a corresponding batch file. Double click on a batch file to run its associated script. These batch files were added purely for portability and convenience. (See [[PHP WinBinder 2: PHC-Win | '''PHC-win''']] on how to create executables).<br />
<br />
Run '''manytests_main.bat''' which provides an excellent example showing all controls available.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Form Editor ==<br />
Form editor is an excellent tool for positioning Windows controls. This overview will quickly get you up and running:<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
Navigate to folder C:\us_wb\wb\'''form_editor''' and<br />
double click on the batch file '''Run_form_editor.bat'''. This runs the form editor.<br />
<br />
You will see three floating windows as shown on the right.<br />
<br />
* '''A)''' Main application window<br />
* '''B)''' The application you are designing<br />
* '''C)''' Control (component) selector. You can close this and use the drop down menu '''D)'''<br />
<br />
<br />
* '''E)''' After adding controls, they are listed in this window. Click any item in the&lt;br /&gt; list to select a control; alternatively click on a control in the application design window.<br />
* '''F)''' This window displays additional styles that you can add to a control.<br />
* '''G)''' These four controls allow you to finely tune the position of a selected control.<br />
<br />
<br />
'''Explore'''<br />
<br />
Explore the form-editor, add controls move them around.&lt;br /&gt;Get a feel for laying out controls.<br />
<br />
'''Delete a control'''<br />
<br />
You can delete a control by first selecting it and using menu '''Edit &gt; Delete control'''<br />
<br />
'''Preview application'''<br />
<br />
* Select '''View &gt; Preview form'''<br />
* Displays what an application will look like <br />
<br />
<br />
The form editor '''does not''' add functionality to any controls. It is purely a layout tool. Saving a project automatically exports a PHP script (file) containing layout information which you can use either directly or cut and paste the parts you require.<br />
|<br />
[[Image:WinBinder_FE_1.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
== Tutorial ==<br />
This tutorial is intended to show the mechanics of creating a windows application using WinBinder and PHC-Win.<br />
<br />
So as not to mask details of this process, the example is intentionally basic.<br />
<br />
'''''Specification'''''<br />
<br />
The application has two buttons, each toggling the state of its corresponding image.<br />
Several small files are used to simulate a larger project and demonstrate PHC-Win capabilities.<br />
<br />
=== Preliminary ===<br />
Every application requires a main folder to store the files and resources.<br />
<br />
Create a new folder named '''my_app''' (or any other name) in folder C:\'''us_wb''' (can be a different location).<br />
<br />
The reason for choosing this location is one of portability. You can copy folder '''us_wb''' to a USB memory stick and take your entire project set with you.<br />
<br />
==== Basic Windows app ====<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Basic Windows app'':'''<br />
<br />
Each Windows application has a common format. To save typing, you will find a template in folder C:\us_wb\wb\us_tutorial. Copy the two files '''z_basic.bat''' and '''z_basic.phpw''' to folder C:\us_wb\'''my_app'''.<br />
<br />
* '''z_basic.bat''' Required to run the application z_basic.phpw. It opens a command window that does not close while the application is running. Any PHP error messages are displayed in this window.<br />
* '''z_basic.phpw''' This template is our starting point for a new application.<br />
<br />
<br />
''Errors'':<br />
<br />
Well! Even from this starting point we have introduced errors!<br />
<br />
Running '''z_basic.bat''' (Double click on file) produces the following:<br />
&lt;pre&gt;<br />
The system cannot find the path specified.<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
The error message is clear: both files contain incorrect paths.<br />
<br />
These files contain relative paths &quot;'''..\php'''.&quot; The two periods means move up one folder level and down into folder php. but it cannot find the folder php. This folder resides inside folder &quot;'''wb'''&quot; and must be included in the paths as shown in the next section.<br />
|<br />
&amp;nbsp;<br />
|<br />
'''z_basic.bat'''<br />
&lt;pre&gt;<br />
..\php\php.exe -c ..\php\php-wb.ini z_basic.phpw<br />
&lt;/pre&gt;<br />
'''z_basic.phpw'''<br />
&lt;pre&gt;<br />
&lt;?php<br />
Include &quot;../php/include/winbinder.php&quot;; // Location Of Winbinder Library<br />
<br />
//--- Constants ---------------------------------------------------------------<br />
<br />
//=== 1) Create main window ---------------------------------------------------<br />
$mainwin = wb_create_window(NULL, AppWindow, &quot;z_basic&quot;, 320, 240);<br />
<br />
//=== 2) Create controls for the main window ----------------------------------<br />
<br />
//=== 3) Assign handler function to the main window --------------------------<br />
wb_set_handler($mainwin, &quot;process_main&quot;); <br />
<br />
//=== 5) Enter application loop -----------------------------------------------<br />
wb_main_loop(); <br />
<br />
//=== 4) Handler Function -----------------------------------------------------<br />
function process_main($window, $id) <br />
{<br />
switch($id) { <br />
<br />
case IDCLOSE: // Constant IDCLOSE (8) predefined <br />
wb_destroy_window($window); // Destroy the window<br />
break; <br />
}<br />
}<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
<br />
==== Basic Windows app with corrected paths ====<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Basic Windows app with corrected paths'':'''<br />
<br />
After correcting the path, run '''z_basic.bat''' again.<br />
This time the basic Windows application will run.<br />
<br />
<br />
Our application looks a bit sparse, however the structure is in place.<br />
<br />
We will use the form editor to layout all controls. This will automatically provide code for '''constants''' and '''control creation''' sections.<br />
<br />
But before doing this, it is worth making a list of ID names and caption values to be used in the application.<br />
<br />
We have two buttons that can have the following IDs and captions:<br />
* IDC_BUTTONRED1 - Button ID<br />
* Red 1 - Button caption - Code toggles between Red 1 and Green 1<br />
<br />
* IDC_BUTTONRED2 - Button ID<br />
* Red 2 - Button caption - Code toggles between Red 2 and Green 2<br />
<br />
*IDC_FRAMERED1 - An image frame to contain image red.bmp<br />
*IDC_FRAMEGREEN1 - An image frame to contain image green.bmp<br />
*IDC_FRAMERED2 - An image frame to contain image red.bmp<br />
*IDC_FRAMEGREEN2 - An image frame to contain image green.bmp<br />
<br />
|<br />
&amp;nbsp;<br />
|<br />
'''z_basic.bat'''<br />
&lt;pre&gt;<br />
..\wb\php\php.exe -c ..\wb\php\php-wb.ini z_basic.phpw<br />
&lt;/pre&gt;<br />
'''z_basic.phpw'''<br />
&lt;pre&gt;<br />
&lt;?php<br />
Include &quot;../wb/php/include/winbinder.php&quot;; // Location Of Winbinder Library<br />
<br />
//--- Constants ---------------------------------------------------------------<br />
<br />
//=== 1) Create main window ---------------------------------------------------<br />
$mainwin = wb_create_window(NULL, AppWindow, &quot;z_basic&quot;, 320, 240);<br />
<br />
//=== 2) Create controls for the main window ----------------------------------<br />
<br />
//=== 3) Assign handler function to the main window --------------------------<br />
wb_set_handler($mainwin, &quot;process_main&quot;); <br />
<br />
//=== 5) Enter application loop -----------------------------------------------<br />
wb_main_loop(); <br />
<br />
//=== 4) Handler Function -----------------------------------------------------<br />
function process_main($window, $id) <br />
{<br />
switch($id) { <br />
<br />
case IDCLOSE: // Constant IDCLOSE (8) predefined <br />
wb_destroy_window($window); // Destroy the window<br />
break; <br />
}<br />
}<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
<br />
=== Create Form ===<br />
I have not provided details for a control’s position. That’s your choice. Frame sizes are important because they must match our images; these are 20x12 pixels.<br />
<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
Before creating a form, it is best to create a new folder that will contain the resulting form (referred to as a project). Create a new folder named '''my_project''' (or any other name) in folder C:\'''us_wb''' <br />
<br />
Start form editor by running C:\us_wb\wb\form_editor\'''Run_form_editor.bat'''<br />
<br />
* Add a PushButton, change ID to '''IDC_BUTTONRED1''', change caption to '''Red 1'''<br />
* Create a second button, change ID to '''IDC_BUTTONRED2''', change caption to '''Red 2'''. Move this button just below the first button<br />
<br />
<br />
* Create a Frame, change ID to '''IDC_FRAMERED1''', delete the caption. In the styles select (check) the '''image box'''. Change the width to '''20''' and height to '''12'''. Move the frame to the right of button 1.<br />
* Create a Frame, change ID to '''IDC_FRAMGREEN1''', delete the caption. In the styles select (check) the image box. Change the width to 20 and height to 12. Move the frame to the right of button 1 ('''left and top''' values identical to the above frame).<br />
<br />
<br />
*Create a Frame, change ID to '''IDC_FRAMERED2''', delete the caption. In the styles, select (check) the '''image box'''. Change the width to 20 and height to 12. Move the frame to the right of button 2.<br />
*Create a Frame, change ID to '''IDC_FRAMGREEN2''', delete the caption. In the styles, select (check) the '''image box'''. Change the width to 20 and height to 12. Move the frame to the right of button 2 (left and top values identical to the above frame).<br />
<br />
* Resize the application window so the buttons and frame are in the center of the window.<br />
<br />
Save the project with name '''my.prj''' to folder '''my_proj''' as follows:<br />
* Top menu, select '''File &gt; Save Project as'''<br />
* Navigate to folder '''my_project'''<br />
* Enter '''my.prj'''<br />
* Click save<br />
* Exit form editor, select '''File &gt; Exit'''<br />
|<br />
[[Image:WinBinder_FE_2.gif]]<br />
|}<br />
<br />
==== Exported file ====<br />
The form editor automatically exports a PHP file corresponding to the form component layout.<br />
This file can be found in our project folder.<br />
<br />
In this example, it is named '''my.form.php''' and has the following content:<br />
&lt;pre&gt;<br />
&lt;?php<br />
<br />
/*******************************************************************************<br />
<br />
WINBINDER - form editor PHP file (generated automatically)<br />
<br />
*******************************************************************************/<br />
<br />
// Control identifiers<br />
<br />
if(!defined('IDC_BUTTONRED1')) define('IDC_BUTTONRED1', 1);<br />
if(!defined('IDC_BUTTONRED2')) define('IDC_BUTTONRED2', 2);<br />
if(!defined('IDC_FRAMERED1')) define('IDC_FRAMERED1', 3);<br />
if(!defined('IDC_FRAMEGREEN1')) define('IDC_FRAMEGREEN1', 4);<br />
if(!defined('IDC_FRAMERED2')) define('IDC_FRAMERED2', 5);<br />
if(!defined('IDC_FRAMEGREEN2')) define('IDC_FRAMEGREEN2', 6);<br />
<br />
// Create window<br />
<br />
$mainwin = wb_create_window(null, AppWindow, '(Empty Form)', WBC_CENTER, WBC_CENTER, 195, 141, 0x00000000, 0);<br />
<br />
// Insert controls<br />
<br />
wb_create_control($mainwin, PushButton, 'Red 1', 20, 20, 90, 25, IDC_BUTTONRED1, 0x00000000, 0, 0);<br />
wb_create_control($mainwin, PushButton, 'Red 2', 20, 60, 90, 25, IDC_BUTTONRED2, 0x00000000, 0, 0);<br />
wb_create_control($mainwin, Frame, '', 141, 23, 20, 12, IDC_FRAMERED1, 0x00000004, 0, 0);<br />
wb_create_control($mainwin, Frame, '', 141, 23, 20, 12, IDC_FRAMEGREEN1, 0x00000004, 0, 0);<br />
wb_create_control($mainwin, Frame, '', 141, 63, 20, 12, IDC_FRAMERED2, 0x00000004, 0, 0);<br />
wb_create_control($mainwin, Frame, '', 141, 63, 20, 12, IDC_FRAMEGREEN2, 0x00000004, 0, 0);<br />
<br />
// End controls<br />
<br />
?&gt;<br />
&lt;/pre&gt;<br />
<br />
==== Copy and paste ====<br />
At this stage we can start building our application.<br />
<br />
Copy images files ('''uslogo.ico''', '''red.bmp''' and '''green.bmp''') from folder C:\us_wb\wb\'''us_tutorial''' to folder C:\us_wb\'''my_app'''.<br />
<br />
* Open files C:\us_wb\my_app\'''z_basic.phpw''' and C:\us_wb\my_project\'''my.form.php''' in a text editor.<br />
* From my.form.php copy “Control identifiers” section and past in to z_basic.phpw under the Constants section.<br />
* From my.form.php copy “Insert controls” section and past in to z_basic.phpw under the “2) Create controls for the main window” section.<br />
* In z_basic.phpw change wb_create_window to have the same width and height as that in my.form.php.<br />
<br />
==== Assign Images ====<br />
Use the following code to assign images to the frames. Place code at end of section “2) Create controls for the main window” <br />
&lt;pre&gt;<br />
// Assign images to frames<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN1),'green.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2), 'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2),'green.bmp', NOCOLOR); <br />
&lt;/pre&gt; <br />
<br />
<br />
Add a logo image to the application window.<br />
&lt;pre&gt;<br />
//=== 3) Assign handler function to the main window --------------------------<br />
wb_set_handler($mainwin, &quot;process_main&quot;);<br />
wb_set_image($mainwin, &quot;uslogo.ico&quot;); // Add logo <br />
&lt;/pre&gt;<br />
<br />
==== Test ====<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
* Run C:\us_wb\my_app\'''z_basic.bat'''<br />
* Application shown on right.<br />
* Currently buttons do nothing code to be added later. <br />
|<br />
[[Image:WinBinder_FE_3.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
That completes the form editor introduction. You will appreciate how useful it is when you work with a larger application.<br />
<br />
If you need to add additional controls or move the existing controls around, open your project file in form editor, make the changes and transfer these to your application. That really does save time.<br />
<br />
Before looking at PHC-Win, the [[PHP WinBinder 2: Add code | '''next page''']] covers adding functionality to the buttons. This functionality is spread across several files, providing PHC-Win with more than a single file to process.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Cron_Design:_Cron_Script_Part_2&diff=4884Cron Design: Cron Script Part 22010-11-24T10:23:38Z<p>Upazixorys: </p>
<hr />
<div>=[http://osobageqys.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Nav Cron Design}}<br />
At the heart of Uniform Server’s portable Cron is a configuration file. This is periodically read into an array the period is defined by Cron time, which has a default setting of one minute. The array is scanned line-by-line comparing any time settings to the current time on finding a match the corresponding script is run.<br />
<br />
This page looks at the foreach loop in detail.<br />
<br />
== Block Parameters ==<br />
Before performing any foreach-loop logic processing, option values need to be extracted from the configuration file.<br />
<br />
Every time the script is run the configuration file is read into an array. First task of the foreach-loop is to extract a block’s option values. Each time around the loop selects a new block and extracts its option values. <br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Read Configuration file'':'''<br />
* Cron’s configuration file '''cron.ini''' is read into array '''$ini_array'''<br />
* PHP function's '''parse_ini_file''' has second parameter set to '''true'''<br />
* This preserves the file structure when saved to array.<br />
|<br />
'''''Function Used'':'''<br />
&lt;pre&gt;<br />
<br />
$ini_array = parse_ini_file($file, true);<br />
<br />
&lt;/pre&gt;<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Extract Option Value'':'''<br />
* Having the structure preserved means the array can be scanned with&amp;nbsp;&lt;br /&gt;a foreach loop that targets only the block title.<br />
* Hence array '''$key''' holds a block title.<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
foreach($ini_array as $key =&gt; $value){ <br />
} <br />
&lt;/pre&gt; <br />
|}<br />
* This $key is used to target options in the bock as follows:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
$tim = strtotime(&quot;now&quot;); //current time<br />
$tim_s = strtotime($ini_array[$key]['start']);<br />
$period = $ini_array[$key]['period'];<br />
$path = $ini_array[$key]['path'];<br />
$ref = $ini_array[$key]['ref'];<br />
&lt;/pre&gt; <br />
|}<br />
'''''Note'':''' All times are converted to Unix timestamps.<br />
*''' $tim''' Is the current time, all times are compared to this.<br />
* '''$tim_s''' Initial start time extracted from a block option.<br />
<br />
|<br />
'''''Configuration file example'':'''<br />
&lt;pre&gt;<br />
<br />
[dtdns]<br />
start = 2009-09-21 2:56:52<br />
eriod = 600 ; 10 Mins as required by DtDNS<br />
;path = ..\..\plugins\dtdns_updater\dtdns_updater.php<br />
ref = <br />
<br />
[db_backup]<br />
start = 2009-09-21 2:56:52<br />
period = hourly<br />
path = ..\..\plugins\db_backup\db_backup.php<br />
ref = <br />
<br />
[moodle]<br />
start = 2009-09-21 2:56:52<br />
period = hourly<br />
path = http://localhost/moodle/admin/cron.php<br />
ref = <br />
<br />
[drupal]<br />
start = 2009-09-21 2:56:52<br />
period = hourly<br />
path = http://localhost/drupal/cron.php<br />
ref = <br />
<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Froreach logic ==<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Description'':'''<br />
<br />
The '''foreach''' logic consists of three '''if''' statements. <br />
<br />
The first thing to note all time comparisons are relative meaning they use only the greater than or less than comparison. This caters for situations where a user moves the servers from one machine to another. Using an equal’s comparison would potential miss a time slot?<br />
<br />
Strictly speaking a start time is not necessary however it does allow staggering of intensive processes by specify a different start time for each process to be run.<br />
<br />
* '''''First if'':''' Is it a new start time or a continuation of a previously triggered time.<br />
** If the start time is greater than current time a user must have set a new start time. Since this has not been reached there is nothing to do hence force the '''foreach''' loop to '''continue'''.<br />
**If the start time is less than current time either a new start time has been reached or it’s a continuation of a previously triggered start time. Hence further processing required.<br />
<br />
<br />
* '''''Second if'':''' Is this a continuation of a previously triggered start time or a new start time?<br />
**If ref is blank a user has requested a new start time. Immediately create a new start reference time by summing the current time and period, save this to the configuration file. Run the required script.<br />
**If ref is not blank it’s a potential trigger event hence further processing required.<br />
<br />
<br />
* '''''Third if'':'''Is this a new trigger event?<br />
** If the ref time is greater than current time a trigger event has not been reached. Hence nothing to do force the foreach loop to continue.<br />
** If the ref time is less than current time a trigger event has occurred. Create a new start reference time by summing current time and period, save this to the configuration file. Run the required script.<br />
|<br />
[[Image:Cron_flow_2.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
== Froreach logic - Alternative flow diagram==<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Description'':'''<br />
<br />
This flow diagram and the above are functionally identical. The above is easier to understand however if directly translated into code leads to the use of a function which is strictly not required.<br />
<br />
I prefer the flow diagram on the right although slightly more difficult to read is directly translatable into code and does not require the use of a function.<br />
<br />
'''''Code Snippet'':'''<br />
&lt;pre&gt;<br />
$ini_array = parse_ini_file($file, true); // Read cron.ini into array<br />
foreach($ini_array as $key =&gt; $value){ // Scan array's main keys<br />
<br />
$tim = strtotime(&quot;now&quot;); //current time<br />
$tim_s = strtotime($ini_array[$key]['start']); // Start time<br />
$period = $ini_array[$key]['period']; // Period<br />
$path = $ini_array[$key]['path']; // Path to run script<br />
$ref = $ini_array[$key]['ref']; // Repeat time marker<br />
<br />
if((float)$tim &gt; (float)$tim_s){ // New start or started<br />
if( $ref != &quot;&quot;){ // It was started<br />
if( (float)$tim &lt; (float)$ref ){ // Is it a triggered update <br />
continue; // No: Start next foreach<br />
}<br />
}<br />
//== Eiter a new start or triggered update hence run script<br />
<br />
$ref = $tim + $period; // Create new repeat time marker<br />
my_ini_set($file,$key,'ref',$ref); // Save to ini file for later use <br />
<br />
// Code to Run File here<br />
}//if<br />
}// End foreach<br />
&lt;/pre&gt;<br />
<br />
|<br />
'''''Flow Diagram'''''<br />
[[Image:Cron_flow_3.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
That completes all main design areas for portable Cron.<br />
<br />
Main point’s script uses relative comparisons so as not to miss a time event. All time references use a Unix timestamp.<br />
<br />
Final script is shown on the [[Cron Design: Cron Script Part 3 | '''next page''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Debugging_Tips&diff=4880Debugging Tips2010-11-24T10:23:21Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ybyfonojot.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ybyfonojot.co.cc CLICK HERE]=<br />
----<br />
</div><br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Debugging Tips <br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''General Debugging Tips including 3.5-Apollo Specific'''<br />
|}<br />
{|<br />
| [[Image:uc_debug.gif]]<br />
||<br />
I have always advocated go in hack Uniform Server around and break it. This little chap is the result of a session where I could not resolve the reason why I broke it. I decided to animate his eyes and antenna serves as a reminder not to go in heavy handed.<br />
|}<br />
This page contains a few tips that will assist you in debugging on Uniform Server.<br />
<br />
== What’s my IP? ==<br />
There are many on line services that will provide your IP address for example click this link:<br />
[http://www.whatsmyip.org/ Whats My IP] you cant miss it, top right big and bold.<br />
<br />
On the above page try the “More Info About You” link. <br />
<br />
== Checking your server is externally accessible ==<br />
You have popped your servers on-line and wondering if they are accessible from the Internet. Google translate is ideal for this, in order to translate a page it needs access to your servers (Exactly what we need and fully automated.).<br />
<br />
# Go to Google Translate page: [http://www.google.com/translate_t Google Translate]<br />
# Select '''Text and Web''' top menu bar ('''''Automatically selected''''' for you)<br />
# Bottom of page you will find a text field '''Translate a web page''' enter a valid address for your page:<br />
## It accepts IP addresses for example &lt;nowiki&gt;http://89.007.251.102/test/index.html&lt;/nowiki&gt;<br />
## Or domain names for example: &lt;nowiki&gt;http://fred.com/test/index.html&lt;/nowiki&gt;<br />
# Select any language from the drop down list.<br />
# Click Translate<br />
## '''If the page is accessible it is translated.'''<br />
## If its not accessible a blank page is displayed.<br />
<br />
Quick and effective that’s what I like.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Apache not starting - httpd.conf syntax check 1 ==<br />
If you have made changes to Apache configuration file '''''httpd.conf''''' and find Apache no longer runs the chances are you made a typo? Apache will not run if there is a syntax error in the configuration file however the virtual drive (default '''W''') may have been created if so you can use the following to check for syntax errors:<br />
<br />
Open a command prompt ('''run''' &gt; type '''cmd''' &gt; click '''Ok''')<br />
<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#e8e8e8&quot;&gt;<br />
'''&amp;nbsp;&amp;nbsp;In&amp;nbsp;the&amp;nbsp;pop-up&amp;nbsp;window&amp;nbsp;type&amp;nbsp;the&amp;nbsp;following&amp;nbsp;shown&amp;nbsp;in&amp;nbsp;bold:&amp;nbsp;&amp;nbsp;'''<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#f5f5f5&quot;&gt;<br />
C:\Documents and Settings\fred&gt;'''w:'''&lt;br&gt; <br />
W:\&gt;'''cd usr\local\apache2\bin'''&lt;br&gt;<br />
W:\usr\local\apache2\bin&gt;'''apache.exe -t'''&lt;br&gt;<br />
Syntax OK<br />
<br />
W:\usr\local\apache2\bin&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/td&gt;<br />
&lt;td width=&quot;10&quot;&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td width=&quot;100%&quot;&gt;<br />
This will run Apache and check the configuration syntax.<br />
<br />
*'''w:''' Selects the virtual drive change this if using a different one<br />
<br />
*'''cd''' Move to folder where the Apache program is<br />
<br />
*'''apache.exe -t''' Runs Apache with test flag -t<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
Any syntax errors will be reported.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Apache not starting - httpd.conf syntax check 2 ==<br />
If Apache fails to start its more than likely the virtual drive will not be created. The following batch file will create a virtual drive and test the syntax. This batch file may be run with or without the servers running. <br />
<br />
Save the following to a file named '''uc_apache_syntax.bat''' place the file in folder '''Uniform Server''' double click to run.<br />
<br />
&lt;pre&gt;<br />
:Batch file to check Apache configuration syntax<br />
:Creates a virtual drive if it does not already exist<br />
:Optionally removes the virtual drive created<br />
:Place in folder ”Uniform Server” with other bat files<br />
:File: uc_apache_syntax.bat<br />
:Author: Mike Gleaves<br />
:Version: 1.0<br />
:Date: 25-1-2008<br />
<br />
@echo off<br />
<br />
:== Set drive to W change this as required<br />
set Disk=W<br />
<br />
:== create virtual disk and map folder udrive to it<br />
subst %Disk%: &quot;udrive&quot;<br />
<br />
:== Clear screen hides error if already created <br />
cls<br />
<br />
:== select drive, change to folder, run apache command,<br />
<br />
%Disk%:<br />
cd usr\local\apache2\bin<br />
apache.exe -t<br />
<br />
:== User option to remove virtual drive<br />
echo.<br />
echo.<br />
SET remove_disk=N<br />
SET /P remove_disk=Remove virtual drive %Disk% type Y or y press enter =<br />
IF %remove_disk%==N goto :NOTREMOVED<br />
IF %remove_disk%==Y goto :REMOVE<br />
IF %remove_disk%==y goto :REMOVE<br />
<br />
:NOTREMOVED<br />
echo.<br />
echo &quot;Disk has not been removed&quot;<br />
goto :END<br />
<br />
:REMOVE<br />
echo.<br />
echo &quot;Disk removed&quot;<br />
subst %Disk%: /d<br />
<br />
:END<br />
echo.<br />
pause<br />
&lt;/pre&gt;<br />
<br />
File details and notes:<br />
<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000&quot; width=&quot;500&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#e8e8e8&quot;&gt;<br />
&lt;div style=&quot;text-align:center&quot;&gt;'''file: uc_apache_syntax.bat'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#f5f5f5&quot;&gt;<br />
@echo off<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;== Set drive to W change this as required&lt;br&gt;<br />
'''set Disk=W'''<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;== create virtual disk and map folder udrive to it&lt;br&gt;<br />
subst %Disk%: &quot;udrive&quot;<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;== Clear screen hides error if already created&lt;br&gt;<br />
cls<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;== select drive, change to folder, run apache command,&lt;br&gt;<br />
<br />
%Disk%:<br />
cd usr\local\apache2\bin<br />
'''apache.exe -t'''<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;== User option to remove virtual drive&lt;br&gt;<br />
echo.&lt;br&gt;<br />
echo.&lt;br&gt;<br />
SET remove_disk=N&lt;br&gt;<br />
SET /P remove_disk=Remove virtual drive %Disk% type Y or y press enter =&lt;br&gt;<br />
IF %remove_disk%==N goto :NOTREMOVED&lt;br&gt;<br />
IF %remove_disk%==Y goto :REMOVE&lt;br&gt;<br />
IF %remove_disk%==y goto :REMOVE&lt;br&gt;<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;NOTREMOVED&lt;br&gt;<br />
echo.&lt;br&gt;<br />
echo &quot;Disk has not been removed&quot;&lt;br&gt;<br />
goto :END<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;REMOVE&lt;br&gt;<br />
echo.&lt;br&gt;<br />
echo &quot;Disk removed&quot;&lt;br&gt;<br />
subst %Disk%: /d&lt;br&gt;<br />
<br />
&lt;nowiki&gt;:&lt;/nowiki&gt;END&lt;br&gt;<br />
echo.&lt;br&gt;<br />
pause<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/td&gt;<br />
&lt;td width=&quot;10&quot;&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot;&gt;<br />
'''''Notes:'''''<br />
<br />
*You may run this file even when the servers are running.<br />
<br />
If the servers are not running a virtual disk drive is created the default is “W” if you are using a different disk change the line: set '''Disk=W''' accordingly.<br />
<br />
<br />
The next lines run the apache command '''–t''' to verify the configuration file syntax<br />
<br />
Note: Command -t must be run from the virtual drive and not from where Uniform Server was extracted otherwise the following error is generated:<br />
<br />
:'''''Syntax error on line 69 of G:/0_1/Uniform Server/udrive/usr/local/apache2/conf/h ttpd.conf: ServerRoot must be a valid directory'''''<br />
<br />
Hence these lines are required in the batch file they change the working disk and directory:<br />
<br />
:'''%Disk%:'''&lt;br&gt;<br />
:'''cd usr\local\apache2\bin'''<br />
<br />
<br />
The remaining lines provide an option to remove the virtual drive created.<br />
<br />
* If the drive already created (servers running) prior to running '''uc_apache_syntax.bat''' do not use it to delete the drive otherwise you will be unable to shutdown the servers (just means you will need to kill the processes manually). <br />
<br />
* If you are performing a syntax check without running the servers then delete the virtual drive otherwise the servers will not start when using Server_Start.bat <br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
'''''[[#top | Top]]'''''<br />
<br />
== Apache - Log files ==<br />
Apache logs all its transactions to the following file access.log and errors to '''error.log''' these are located in folder:<br />
<br />
'''*\Uniform Server\udrive\usr\local\apache2\logs'''<br />
<br />
when debugging Apache problems make this your first port of call .<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Mod Rewrite - Log file ==<br />
Logs all Mod Rewrite transactions to a file using “RewriteLog” and “RewriteLogLevel” directives. These instructions cannot be placed in an htaccess file they must be placed in Apache’s main configuration file httpd.conf preferably in a Vhost. <br />
<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;table border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000&quot; width=&quot;450&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#e8e8e8&quot; &gt;<br />
&lt;div align=&quot;center&quot;&gt;'''File: httpd.conf'''&lt;br&gt;<br />
'''Location: *Uniform Server\udrive\usr\local\apache2\conf'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#f5f5f5&quot;&gt;<br />
NameVirtualHost *&lt;br&gt;<br />
&lt;VirtualHost *&gt;&lt;br&gt;<br />
ServerName localhost:80&lt;br&gt;<br />
DocumentRoot /www<br />
<br />
'''RewriteLog &quot;logs/rewrite.txt&quot;'''&lt;br&gt;<br />
'''RewriteLogLevel 9'''<br />
<br />
&lt;/VirtualHost&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/td&gt;<br />
&lt;td width=&quot;10&quot;&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;td width=&quot;100%&quot;&gt;<br />
*'''RewriteLog:''' Sets the log file name to which the server logs all rewrite transactions.(use any name you like)<br />
<br />
*'''RewriteLogLevel:''' Sets the log level. Maximum log level is &quot;9&quot; will log almost all-rewriting transactions a setting of &quot;0? will disable rewrite logging. Choose a value that best suits your needs, try a value of “3 or 5”<br />
<br />
*'''Note:''' The log file rewrite.log will be found in folder: *Uniform Server\udrive\usr\local\apache2\logs<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
'''''Note:''''' Only enable these lines while testing do not use on a live server because logging will quickly eat your disk space. Comment out the lines (by placing # at the start of the line) or delete after testing, you may also wish to delete the log file (rewrite.txt).<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Troubleshooting]]<br />
[[Category: Support]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Admin_Panel_2:_Restart_Services&diff=4879Admin Panel 2: Restart Services2010-11-24T10:23:21Z<p>Upazixorys: </p>
<hr />
<div>=[http://olitudyxej.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Uc_nav_apanel2}}<br />
Clicking '''Restart Services''' opens this confirmation page, before restarting either Apache or MySQL '''service'''. requires you to click one of the links below.<br />
<br />
&lt;div style=&quot;width:75%;background:#e2fef9;padding:8px&quot;&gt;<br />
&lt;div style=&quot;background:#4F4F97;font-size:16px;color:#ffffff;padding:4px&quot;&gt;'''» Restart Server'''&lt;/div&gt;<br />
{|width=&quot;75%&quot; style=&quot;background:#e2fef9;&quot;<br />
|-<br />
|<br />
This script will restart the services.&lt;br&gt;<br />
It may take some time.<br />
<br />
I am sure: [[#top|Restart Apache2 Service]]&lt;br&gt;<br />
I am sure: [[#top|Restart MySQL Service]]<br />
|}<br />
&lt;/div&gt;<br />
<br />
'''''Note'':''' The above links only work when the servers have been installed as a service.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Running as a service ==<br />
For completeness I have included the READ ME.txt file located in folder '''*\Uniform Server\udrive\plugins\Services'''<br />
<br />
&lt;pre&gt;<br />
---------------------<br />
A T T E N T I O N !!!<br />
---------------------<br />
<br />
Do not start any of the scripts in this directory until you are sure you know what you are doing.<br />
<br />
The origanl server was not desined to works as as NT service.<br />
<br />
For users who want to use Apache2 as service on windows NT there is the next files:<br />
<br />
+ run.bat - Installs Apache2 and MySQL as windows services; (a directory C:\UniServerX.X\ will be created)<br />
+ w2c1.pl - Perl script;<br />
<br />
To uninstall the services run: C:\UniserverX.X\Uninstall.bat<br />
<br />
For further information read: http://httpd.apache.org/docs-2.0/platform/windows.html<br />
<br />
<br />
-------------------------------------------------------<br />
Copyright 2002-2004 The Uniform Server Development Team<br />
All rights reserved.<br />
<br />
The authors were trying to make the best product. But they<br />
can not be responsible for any type of damages or troubles<br />
caused by using this or another software.<br />
&lt;/pre&gt;<br />
<br />
Do read the documentation at [http://httpd.apache.org/docs-2.0/platform/windows.html Apache.org]<br />
<br />
'''''Windows NT'':''' This means all versions of Windows that are based on the Windows NT kernel.<br />
Includes Windows NT, Windows 2000, Windows XP and Windows .Net Server 2003.<br />
<br />
Back to '''[[Admin Panel 2|Apanel Introduction]]'''<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: About]]<br />
[[Category: Facts]]<br />
[[Category: Troubleshooting]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Old_talk:Installing_SVN&diff=4876Old talk:Installing SVN2010-11-24T10:22:55Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://atosaca.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
----<br />
=[http://atosaca.co.cc CLICK HERE]=<br />
----<br />
</div><br />
----<br />
&lt;div style=&quot;background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;&quot;&gt;<br />
----<br />
=[http://atosaca.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
----<br />
=[http://atosaca.co.cc CLICK HERE]=<br />
----<br />
&lt;/div&gt;<br />
MrX has reported a problem with SVN working under the /www/ folder...<br />
<br />
This article is still under editing... <br />
<br />
--[[User:Olajideolaolorun|Olajide]] 19:05, 10 Apr 2005 (EDT)<br />
<br />
== 301 Moved Permanently and other errors ==<br />
<br />
This is what happened to me, I'll wait for another person to confirm it before making changes to the wiki.<br />
<br />
Olajide decided to use /www/svn instead of /home/svn, which was my choice. I'm sure he has his valid reasons :)<br />
<br />
From the free SVN book licensed under Creative Commons: <br />
=== [http://svnbook.red-bean.com/en/1.1/apb.html#svn-ap-b-sect-1.2.15 '''I can see my repository in a web browser, but''' &amp;lt;u&amp;gt;svn checkout&amp;lt;/u&amp;gt; '''gives me an error about''' ''301 Moved Permanently''.] ===<br />
&amp;lt;pre&amp;gt;<br />
It means your httpd.conf is misconfigured. Usually this error happens<br />
when you've defined the Subversion virtual “location” to exist within<br />
two different scopes at the same time.<br />
<br />
For example, if you've exported a repository as &amp;lt;Location /www/foo&amp;gt;,<br />
but you've also set your DocumentRoot to be /www, then you're in<br />
trouble. When the request comes in for /www/foo/bar, Apache doesn't<br />
know whether to find a real file named /foo/bar within your<br />
DocumentRoot, or whether to ask mod_dav_svn to fetch a file /bar<br />
from the /www/foo repository. Usually the former case wins, and<br />
hence the &amp;quot;Moved Permanently&amp;quot; error.<br />
<br />
The solution is to make sure your repository &amp;lt;Location&amp;gt; does<br />
not overlap or live within any areas already exported as normal<br />
web shares.<br />
&amp;lt;/pre&amp;gt;<br />
<br />
From what I understand, that means your Repository Root shouldn't be under your Apache DocumentRoot. I decided to try it out for myself.<br />
After changing my Repository Root into /www/svn. I got this error while trying to commit:<br />
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;<br />
D:\Misc\SVN\testbdb&amp;gt;svn commit --message &amp;quot;More Test&amp;quot;<br />
svn: Commit failed (details follow):<br />
svn: OPTIONS request failed on '/svn/testbdb'<br />
svn: OPTIONS of '/svn/testbdb': 301 Moved Permanently (http://localhost)<br />
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;<br />
<br />
I moved changed my Repository Root back to /home/svn and tried again. This is what I got:<br />
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;<br />
D:\Misc\SVN\testbdb&amp;gt;svn commit --message &amp;quot;New Files :D&amp;quot;<br />
Adding 123.txt<br />
Adding New.txt<br />
Transmitting file data ..<br />
Committed revision 6.<br />
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;<br />
<br />
Other than that, I get a bunch of errors like these every time I access my repository:<br />
&amp;lt;pre&amp;gt;<br />
[Sat Apr 09 12:33:27 2005] [error] A subtree cannot specify a different<br />
DAV provider than its parent.<br />
[Sat Apr 09 12:33:27 2005] [error] A subtree cannot specify a different<br />
DAV provider than its parent.<br />
[Sat Apr 09 12:33:28 2005] [error] A subtree cannot specify a different <br />
DAV provider than its parent.<br />
&amp;lt;/pre&amp;gt;<br />
My current guess is that, it has something to do with activating Dav in /www<br />
<br />
--[[User:MrX|MrX]]<br />
<br />
== Finalization ==<br />
<br />
We have concluded and it seems MrX Won! To run SVN, you now have to create a /svn folder in the Uniform Server SUBST Drive. :)<br />
<br />
--[[User:Olajideolaolorun|Olajide]] 14:07, 11 Apr 2005 (EDT)</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Old_talk:Installing_SVN&diff=4872Old talk:Installing SVN2010-11-24T10:22:20Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://atosaca.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
----<br />
=[http://atosaca.co.cc CLICK HERE]=<br />
----<br />
</div><br />
MrX has reported a problem with SVN working under the /www/ folder...<br />
<br />
This article is still under editing... <br />
<br />
--[[User:Olajideolaolorun|Olajide]] 19:05, 10 Apr 2005 (EDT)<br />
<br />
== 301 Moved Permanently and other errors ==<br />
<br />
This is what happened to me, I'll wait for another person to confirm it before making changes to the wiki.<br />
<br />
Olajide decided to use /www/svn instead of /home/svn, which was my choice. I'm sure he has his valid reasons :)<br />
<br />
From the free SVN book licensed under Creative Commons: <br />
=== [http://svnbook.red-bean.com/en/1.1/apb.html#svn-ap-b-sect-1.2.15 '''I can see my repository in a web browser, but''' &lt;u&gt;svn checkout&lt;/u&gt; '''gives me an error about''' ''301 Moved Permanently''.] ===<br />
&lt;pre&gt;<br />
It means your httpd.conf is misconfigured. Usually this error happens<br />
when you've defined the Subversion virtual “location” to exist within<br />
two different scopes at the same time.<br />
<br />
For example, if you've exported a repository as &lt;Location /www/foo&gt;,<br />
but you've also set your DocumentRoot to be /www, then you're in<br />
trouble. When the request comes in for /www/foo/bar, Apache doesn't<br />
know whether to find a real file named /foo/bar within your<br />
DocumentRoot, or whether to ask mod_dav_svn to fetch a file /bar<br />
from the /www/foo repository. Usually the former case wins, and<br />
hence the &quot;Moved Permanently&quot; error.<br />
<br />
The solution is to make sure your repository &lt;Location&gt; does<br />
not overlap or live within any areas already exported as normal<br />
web shares.<br />
&lt;/pre&gt;<br />
<br />
From what I understand, that means your Repository Root shouldn't be under your Apache DocumentRoot. I decided to try it out for myself.<br />
After changing my Repository Root into /www/svn. I got this error while trying to commit:<br />
&lt;pre&gt;&lt;nowiki&gt;<br />
D:\Misc\SVN\testbdb&gt;svn commit --message &quot;More Test&quot;<br />
svn: Commit failed (details follow):<br />
svn: OPTIONS request failed on '/svn/testbdb'<br />
svn: OPTIONS of '/svn/testbdb': 301 Moved Permanently (http://localhost)<br />
&lt;/nowiki&gt;&lt;/pre&gt;<br />
<br />
I moved changed my Repository Root back to /home/svn and tried again. This is what I got:<br />
&lt;pre&gt;&lt;nowiki&gt;<br />
D:\Misc\SVN\testbdb&gt;svn commit --message &quot;New Files :D&quot;<br />
Adding 123.txt<br />
Adding New.txt<br />
Transmitting file data ..<br />
Committed revision 6.<br />
&lt;/nowiki&gt;&lt;/pre&gt;<br />
<br />
Other than that, I get a bunch of errors like these every time I access my repository:<br />
&lt;pre&gt;<br />
[Sat Apr 09 12:33:27 2005] [error] A subtree cannot specify a different<br />
DAV provider than its parent.<br />
[Sat Apr 09 12:33:27 2005] [error] A subtree cannot specify a different<br />
DAV provider than its parent.<br />
[Sat Apr 09 12:33:28 2005] [error] A subtree cannot specify a different <br />
DAV provider than its parent.<br />
&lt;/pre&gt;<br />
My current guess is that, it has something to do with activating Dav in /www<br />
<br />
--[[User:MrX|MrX]]<br />
<br />
== Finalization ==<br />
<br />
We have concluded and it seems MrX Won! To run SVN, you now have to create a /svn folder in the Uniform Server SUBST Drive. :)<br />
<br />
--[[User:Olajideolaolorun|Olajide]] 14:07, 11 Apr 2005 (EDT)</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=5.3-Nano:_DtDNS&diff=48715.3-Nano: DtDNS2010-11-24T10:22:16Z<p>Upazixorys: </p>
<hr />
<div>=[http://elykogit.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Nav 5.3-Nano}}<br />
'''Uniform Server and DtDNS'''<br />
<br />
The majority of domestic Internet connections are via a dynamic IP address, one that can change every time you connect to the Internet. This means you cannot run a web server unless you purchase a static IP address from your ISP (Internet service provider). Even with a static IP, you require an entry in a DNS server that converts your domain name into this IP address, allowing other users to access your server.<br />
<br />
An alternative is to use a free service such as '''DtDNS'''. They provide accounts that allow you to obtain a '''domain name''', and '''tracking software''' to automatically update your IP address when it changes. A big advantage of their free service is that they automatically enable '''Wild cards''' by default.<br />
<br />
Uniform Server supports the DtDNS service by integrating a '''simple PHP script''' to automatically update hostname IP address at DtDNS. The script is configurable, allowing you to update all five free hostnames. The script can optionally be run by cron, making the whole task transparent.<br />
<br />
'''''Note'':''' The script is portable, so popping the servers on a USB memory stick means you can have them on-line and accessible within ten minutes (minimum DNS propagation time) if the new PC host has been configured to allow Internet server traffic.<br />
== DtDNS account ==<br />
Creating an account at DtDNS is extremely easy.<br />
<br />
* Go to DtDNS [http://www.dtdns.com/ '''home'''] page.<br />
* To the right of '''log in''' click '''Create an Account'''<br />
<br />
There are two pages to fill in. Enter the following details:<br />
{|<br />
|&amp;nbsp;||'''''Page 1'':'''||&amp;nbsp;<br />
|-<br />
|1)||'''Desired Username'''||This name is used for logging into your '''account'''<br />
|-<br />
|2)||'''Your Name'''||Your real name (Internal use)<br />
|-<br />
|3)||'''Desired Password'''||A password for logging into your '''account'''<br />
|-<br />
|4)||'''Confirm Password'''||As above<br />
|-<br />
|5)||'''E-mail Address'''||A real active e-mail is required. An activation code is sent to this e-mail address<br />
|-<br />
|6)||'''Confirm E-mail'''||As above<br />
|-<br />
|7)||'''Optional'''||Skip the Optional Information section if you don't wish fill it in.<br />
|-<br />
|8)||'''Two CAPCHA words'''||Enter the two CAPCHA words (if these are difficult to read click the new challenge button) <br />
|-<br />
|&amp;nbsp;||'''''Page 2'':'''||&amp;nbsp;<br />
|-<br />
|9)||'''Username'''||Enter your Username as entered in '''1)'''.<br />
|-<br />
|10)||'''Enter code'''||Enter code sent to your email. (Note: The email contains a link to page 2, hence you could also close the page and wait for the e-mail.)<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Login - Create Hostname ==<br />
'''''General information'':'''<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
*A DtDNS account is limited to '''five free''' hostnames.<br />
* A hostname is concatenated with a '''domain''' name.<br />
* I have listed available domains on the right.&lt;br /&gt;&lt;br /&gt;<br />
* Your full URL, for example<br />
** If you chose '''books''' as hostname<br />
** And select from the drop down menu '''effers.com'''<br />
<br />
Will look like this:<br />
<br />
'''&lt;nowiki&gt;http://&lt;/nowiki&gt;books.effers.com''' <br />
|<br />
&amp;nbsp;&amp;nbsp;<br />
|<br />
{|<br />
|-<br />
|'''''Available Free Domain Names'''''<br />
|-<br />
|<br />
&lt;pre&gt;<br />
3d-game.com<br />
4irc.com<br />
b0ne.com<br />
bbsindex.com<br />
chatnook.com<br />
darktech.org<br />
deaftone.com<br />
dtdns.net<br />
effers.com<br />
&lt;/pre&gt;<br />
|<br />
&lt;pre&gt;<br />
etowns.net<br />
etowns.org<br />
flnet.org<br />
gotgeeks.com<br />
scieron.com<br />
slyip.com<br />
slyip.net<br />
suroot.com<br />
<br />
&lt;/pre&gt;<br />
|}<br />
|}<br />
'''''Wild Cards'':'''<br />
<br />
After creating a hostname, wild cards are enabled by default. This allows you to use a URL such as <br />
<br />
&lt;nowiki&gt;http://&lt;/nowiki&gt;'''www.'''books.effers.com - Note '''www.''' is the wild card part. This can be anything you like; for example:<br />
<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www-internation.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;local.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.home.'''books.effers.com'''<br />
<br />
'''books.effers.com''' resolves to your IP address. You can use the wild card on your server to resolve to different sites.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Create Hostname ===<br />
To create a new hostname at DtDNS<br />
<br />
'''''Login'''''<br />
* Go to [https://www.dtdns.com/index.cfm?fuseaction=account.login | Login page]<br />
* Enter Username: as set in step '''1)''' <br />
* Enter Password: as set in step '''3)''' <br />
* '''My Services''' page displayed<br />
* Click on '''Hostnames'''. This opens the '''Hostname Manager'''<br />
'''''Create hostname'''''<br />
* Enter a desired '''Hostname'''<br />
* From the drop down menu select a Domain <br />
* Click '''Add Hostname'''<br />
* Enter the '''two CAPCHA''' words (if these are difficult to read click the new challenge button) <br />
* Click '''Add Hostname''' button<br />
* This is added to your list of host names<br />
<br />
=== Manage existing hostnames ===<br />
To manage existing hostnames, simply click the entry in the list for example see below.<br />
<br />
{|cellspacing=&quot;6&quot;<br />
|-<br />
|'''Hostname'''||'''Domain'''||'''IP Address'''||'''Type'''<br />
|-<br />
|uni23||dtdns.net||89.119.35.45||Active Dynamic<br />
|-<br />
|books||effers.com||87.129.30.174||Active Dynamic<br />
|}<br />
Click a hostname link to open its corresponding configuration page. Here you can change various settings, including the IP address.<br />
<br />
'''''Note'':''' After adding a new host, the IP address is set to your current IP address. You can manually change it on the configuration page or request an IP update see later.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Script Configuration ==<br />
Edit the following file: UniServer\plugins\dtdns_updater\'''dtdns.ini'''<br />
<br />
For each account you wish to update, add a block with the following format.<br />
{|<br />
|-valign=&quot;top&quot;<br />
|'''[account_1]'''||&amp;nbsp;||- A unique name enclosed in square brackets. Can be any name you wish; do not include spaces. <br />
|-valign=&quot;top&quot;<br />
|'''hostname ='''||&amp;nbsp;|| - Full host name as configured at DtDNS<br />
|-valign=&quot;top&quot;<br />
|'''password ='''||&amp;nbsp;|| - Your DtDNS account password<br />
|}<br />
The configuration file contains examples one shown below:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
;[account_1]<br />
;hostname = books.effers.com<br />
;password = fred123<br />
&lt;/pre&gt;<br />
|}<br />
Uncomment (remove ;) to enable <br />
<br />
Substitute '''books.effers.com''' with your real host and domain names, replace the password '''fred123''' with the one you set in step 1)<br />
<br />
'''''Note'':'''<br />
<br />
Uncomment the blocks as required and substitute your details.<br />
<br />
If you need extra blocks, copy an existing one making sure you change the block name to something unique.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Running Auto-updater Script ==<br />
<br />
=== Manual Update ===<br />
You can run the following batch file to manually force an update, remember to leave around ten minuets before performing another manual update.<br />
<br />
'''''Batch file'':''' UniServer\plugins\dtdns_updater\'''Run_dtdns_updater.bat''' <br />
<br />
'''''Note'':''' It takes around ten minutes for the DNS to propagate. Additional updates within this period are regarded as an abuse and you may find your IP banned.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Cron - Automatic update ===<br />
Cron provides a periodic tick. Uniform Server's default is every ten minutes.<br />
<br />
DtDNS automatic updater has been pre-configured, however it is disabled by default.<br />
<br />
To enable DtDNS, edit file UniServer\unicon\main\'''cron.ini'''<br />
<br />
Locate the dtdns block:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
;[dtdns]<br />
;start = 2009-09-21 2:56:52<br />
;period = 600 ; 10 Mins as required by DtDNS<br />
;path = ..\..\plugins\dtdns_updater\dtdns_updater.php<br />
;ref = <br />
&lt;/pre&gt;<br />
|}<br />
Uncomment to enable as shown below:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
[dtdns]<br />
start = 2009-09-21 2:56:52<br />
period = 600 ; 10 Mins as required by DtDNS<br />
path = ..\..\plugins\dtdns_updater\dtdns_updater.php<br />
ref = <br />
&lt;/pre&gt;<br />
|}<br />
Optionally change the start time. If you do not change this the current time will be used.<br />
<br />
When Cron is initially run DtDNS will immediately run and thereafter will run every ten minutes.<br />
<br />
'''''Note 1'':''' An update is performed only if your IP address has changed. <br />
<br />
'''''Note 2'':''' You need to start Cron either manually or automatically. Refer to [[5.3-Nano: Portable Cron | '''Cron page''']] for details.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Logging ==<br />
Logging is enabled by default. Log file: UniServer\plugins\dtdns_updater\'''dtdns.log'''<br />
<br />
Disable enable logging edit file: UniServer\plugins\dtdns_updater\'''dtdns_updater.php'''<br />
<br />
Change the following line as required:<br />
<br />
'''$logging = true;''' // true = Enable logging false = disable logging<br />
<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
For a home web server the free account at DtDNS is ideal. At least it gives you an opportunity to test their service. Perhaps it will encourage you to purchase a real domain and use some of their paid services.<br />
<br />
The next page looks at configuring the [[5.3-Nano: Database Backup | '''Database Backup''']] CLI script.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Installation]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=5.0-Nano:_DtDNS&diff=48705.0-Nano: DtDNS2010-11-24T10:22:16Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ekygelymib.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ekygelymib.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Nav 5.0-Nano}}<br />
'''Uniform Server and DtDNS'''<br />
<br />
Majority of domestic Internet connections are via a dynamic IP address, one that changes every time you connect to the Internet. This means you cannot run a web server unless you purchase a, static IP address from your ISP (Internet service provider). Even with a static IP you require and entry in a DNS server that converts your domain name into this IP address allowing other users to access your server.<br />
<br />
An alternative is to use a free service such as '''DtDNS''' they provide accounts that allow you to obtain a '''domain name''' and '''tracking software''' to automatically update your IP address as it changes. A big advantage of their free service they automatically enable '''Wild cards''' by default.<br />
<br />
Uniform Server supports the DtDNS service by integrating a, '''simple PHP scrip''' to automatically update hostname IP address at DtDNS. Script is configurable allowing you to update all five free hostnames. The script can optionally be run by cron making the whole task transparent.<br />
<br />
'''''Note'':''' The script is portable hence popping the servers on a USB memory stick means you can have them on-line and accessible within ten minutes (DNS propergation time) if new PC host has been configured to allow Internet server traffic.<br />
<br />
'''''Note'':''' This script has been rewritten now includes a configuration file refer to [[5.3-Nano: DtDNS | '''supplementary section''']] (5.2-Nano and 5.3-Nano) for details.<br />
== DtDNS account ==<br />
Creating an account at DtDNS is extremely easy.<br />
<br />
* Go to DtDNS [http://www.dtdns.com/ '''home'''] page.<br />
* To the right of '''log in''' click '''Create an Account'''<br />
<br />
There are two pages to fill in, enter the following details:<br />
{|<br />
|&amp;nbsp;||'''''Page 1'':'''||&amp;nbsp;<br />
|-<br />
|1)||'''Desired Username'''||This name is used for logging into your '''account'''<br />
|-<br />
|2)||'''Your Name'''||Your real name (Internal use)<br />
|-<br />
|3)||'''Desired Password'''||A password for logging into your '''account'''<br />
|-<br />
|4)||'''Confirm Password'''||As above<br />
|-<br />
|5)||'''E-mail Address'''||A real active e-mail is required, activation code sent to this e-mail address<br />
|-<br />
|6)||'''Confirm E-mail'''||As above<br />
|-<br />
|7)||'''Optional'''||Skip the Optional Information section if you wish fill it in.<br />
|-<br />
|8)||'''Two CAPCHA words'''||Enter the two CAPCHA words (if these are difficult to read click the new challenge button) <br />
|-<br />
|&amp;nbsp;||'''''Page 2'':'''||&amp;nbsp;<br />
|-<br />
|9)||'''Username'''||Enter your Username as entered in '''1)'''.<br />
|-<br />
|10)||'''Enter code'''||Enter code sent to your email. (Note: The email contains a link to page 2 hence you can close the page and wait for the e-mail.)<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Login - Create Hostname ==<br />
'''''General information'':'''<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
*A DtDNS account is limited to '''five free''' hostnames.<br />
* A hostname is concatenated with a '''domain''' name.<br />
* I have listed available domains on the right.&lt;br /&gt;&lt;br /&gt;<br />
* Your full URL for example<br />
** If you chose '''books''' as hostname<br />
** And select from the drop down menu '''effers.com'''<br />
<br />
Will look like this:<br />
<br />
'''&lt;nowiki&gt;http://&lt;/nowiki&gt;books.effers.com''' <br />
|<br />
&amp;nbsp;&amp;nbsp;<br />
|<br />
{|<br />
|-<br />
|'''''Available Free Domain Names'''''<br />
|-<br />
|<br />
&lt;pre&gt;<br />
3d-game.com<br />
4irc.com<br />
b0ne.com<br />
bbsindex.com<br />
chatnook.com<br />
darktech.org<br />
deaftone.com<br />
dtdns.net<br />
effers.com<br />
&lt;/pre&gt;<br />
|<br />
&lt;pre&gt;<br />
etowns.net<br />
etowns.org<br />
flnet.org<br />
gotgeeks.com<br />
scieron.com<br />
slyip.com<br />
slyip.net<br />
suroot.com<br />
<br />
&lt;/pre&gt;<br />
|}<br />
|}<br />
'''''Wild Cards'':'''<br />
<br />
After creating a hostname wild cards are enabled by default. This allows you to use a URL such as <br />
<br />
&lt;nowiki&gt;http://&lt;/nowiki&gt;'''www.'''books.effers.com - Note '''www.''' is the wild card part this can be anything you like for example:<br />
<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www-internation.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;local.'''books.effers.com'''<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.home.'''books.effers.com'''<br />
<br />
'''books.effers.com''' resolves to your IP address you can use the wild card on your server to resolve to different sites.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Create Hostname ===<br />
To create a new hostname at DtDNS<br />
<br />
'''''Login'''''<br />
* Go to [https://www.dtdns.com/index.cfm?fuseaction=account.login | Login page]<br />
* Enter Username: as set in step '''1)''' <br />
* Enter Password: as set in step '''3)''' <br />
* '''My Services''' page displayed<br />
* Click on '''Hostnames''' this opens the '''Hostname Manager'''<br />
'''''Create hostname'''''<br />
* Enter a desired '''Hostname'''<br />
* From the drop down menu select a Domain <br />
* Click '''Add Hostname'''<br />
* Enter the '''two CAPCHA''' words (if these are difficult to read click the new challenge button) <br />
* Click '''Add Hostname''' button<br />
* This is added to your list of host names<br />
<br />
=== Manage existing hostnames ===<br />
To manage existing hostnames, simply click the entry in the list for example see below.<br />
<br />
{|cellspacing=&quot;6&quot;<br />
|-<br />
|'''Hostname'''||'''Domain'''||'''IP Address'''||'''Type'''<br />
|-<br />
|uni23||dtdns.net||89.119.35.45||Active Dynamic<br />
|-<br />
|books||effers.com||87.129.30.174||Active Dynamic<br />
|}<br />
Click a hostname link opens its corresponding configuration page. Here you can change various settings, including the IP address.<br />
<br />
'''''Note'':''' After adding a new host the IP address is set to your current IP address. You can manually change it on the configuration page or request an IP update see later.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Script Configuration ==<br />
You need to configure the script, which can be found in folder:<br />
<br />
UniServer\plugins\dtdns_updater\'''dtdns_updater.php'''<br />
<br />
In the user configuration section locate these lines:<br />
<br />
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;; // Change<br />
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;; // Change or delete<br />
* $id_pw[] = &quot;'''books.effers.com''','''fred123'''&quot;; // Change or delete<br />
Substitute '''books.effers.com''' with your real host and domain names, replace the password '''fred123''' with the one you set in step 1)<br />
<br />
If you have only a single host delete the other two lines. Otherwise modify them for each additional host as above. Add additional lines as required. <br />
<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
/*<br />
###############################################################################<br />
# Name: The Uniform Server DtDNS Updater v 1.0<br />
# Developed By: The Uniform Server Development Team<br />
# Modified Last By: Mike Gleaves (Ric) <br />
# Web: http://www.uniformserver.com<br />
###############################################################################<br />
*/<br />
//error_reporting(0); // Disable PHP errors and warnings<br />
// Comment to Enable for testing<br />
<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once &quot;../../unicon/main/includes/config.inc.php&quot;;<br />
include_once &quot;../../unicon/main/includes/functions.php&quot;;<br />
<br />
run_location_tracker(); // Have servers moved if moved update configuration<br />
print&quot;\n&quot;;<br />
<br />
//######################## User Configuration #################################<br />
// Add as many lines as required with the following format:<br />
// $id_pw[] = &quot;hostname,password&quot;;<br />
// For example:<br />
// $id_pw[] = &quot;books.effers.com,fred123&quot;;<br />
// $id_pw[] = &quot;power.dtdns.net,gun22powder&quot;;<br />
//-----------------------------------------------------------------------------<br />
<br />
$id_pw[] = &quot;books.effers.com,fred123&quot;; // Change<br />
$id_pw[] = &quot;books.effers.com,fred123&quot;; // Change or delete<br />
$id_pw[] = &quot;books.effers.com,fred123&quot;; // Change or delete<br />
<br />
//###################### END User Configuration ###############################<br />
<br />
$test = false; // Test true = display IP address and host names<br />
// false = no display<br />
<br />
foreach ($id_pw as $value) { // Iteratate through array<br />
$idpw_array = explode(&quot;,&quot;,$value); // Split id pw pairs<br />
<br />
if(get_ip_dns($idpw_array[0])){ // Was IP from DNS returned<br />
if(get_ip_current()){ // Yes: Current IP returned<br />
<br />
if($test){ // Test code<br />
print &quot;DNS IP = $ip_dns CURRENT IP = $ip_current $idpw_array[0]&lt;br/&gt;\n&quot;;<br />
}<br />
<br />
if($ip_dns != $ip_current){ // Are IP's different<br />
dtdns_update($idpw_array[0],$idpw_array[1]);// yes: Update required<br />
}<br />
}<br />
}<br />
}// End foreach<br />
<br />
//=== Get IP from DNS server ==================================================<br />
// Input: ID = Hostname:<br />
// Output: Return value true = IP was obtained<br />
// Output: Return value false = IP not obtained or error<br />
// Output: $ip_dns either IP address or host name<br />
<br />
function get_ip_dns($hostname){<br />
global $ip_dns; // IP address saved from DNS server<br />
$ip_dns = gethostbyname($hostname); // Get IP address of hostname<br />
if($ip_dns == $hostname){ // Is hostname returned (not IP address) <br />
return false; // yes: failed to get IP address<br />
}<br />
else{ // no: IP obtained <br />
return true; // set success <br />
}<br />
}<br />
//============================================== END Get IP from DNS server ===<br />
<br />
//=== DtDNS Host Update Page ==================================================<br />
// Input: $id = Hostname:<br />
// Input: $pw = User password<br />
// Output: Return value true = sucess false = failed<br />
<br />
function dtdns_update($id,$pw){<br />
$id_val = urlencode($id); // User Host on DtDNS<br />
$pw_val = urlencode($pw); // User password<br />
$client_val = urlencode('UniServerV1'); // Optional - But added it<br />
$url = 'https://www.dtdns.com/api/autodns.cfm'; // DtDNS update page<br />
<br />
// Build complete URL<br />
$str= $url.&quot;?id=&quot;.$id_val.&quot;&amp;pw=&quot;.$pw_val.&quot;&amp;client=&quot;.$client_val;<br />
<br />
// Access page using Curl SSL<br />
$ch=curl_init(); // Initialize Curl get handle<br />
curl_setopt($ch,CURLOPT_URL,$str); // Set Curl URL option <br />
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // no verify<br />
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10); // timeout set to 10 sceonds<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // curl_exec ouputs a string <br />
$buffer = curl_exec($ch); // run above, save to buffer<br />
curl_close($ch); // Close Curl frees memory<br />
<br />
// Test returned page <br />
if(preg_match(&quot;/now\spoints\sto/&quot;,$buffer)){// Is returne value &quot;now points to&quot;<br />
return true; // yes: update OK<br />
}<br />
else{ // no: Failed<br />
return false;<br />
}<br />
}<br />
//============================================== END DtDNS Host Update Page ===<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Manual Update ===<br />
You can run the following batch file to manually force an update, remember to leave around ten minuets before performing another manual update.<br />
<br />
It takes around ten minutes for the DNS to propagate, additional updates within this period are regarded as an abuse and you may find your IP banned. <br />
<br />
Batch file: UniServer\plugins\dtdns_updater\'''Run_dtdns_updater.bat'''<br />
<br />
Contains:<br />
&lt;pre&gt;<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
rem ### working directory current folder <br />
pushd %~dp0<br />
<br />
..\..\usr\local\php\php.exe dtdns_updater.php<br />
<br />
rem ### restore original working directory<br />
pause<br />
popd<br />
EXIT<br />
&lt;/pre&gt;<br />
'''''[[#top | Top]]'''''<br />
=== Cron - Automatic update ===<br />
Cron provides a periodic tick Uniform Server's default is every ten minutes.<br />
<br />
DtDNS automatic updater has been pre-configured however it is disabled by default.<br />
<br />
To enable Cron edit file UniServer\unicon\main\'''run_cron.php''' <br />
<br />
Locate these two line in section '''List of scripts to be run'''<br />
&lt;pre&gt;<br />
// $cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';<br />
// pclose(popen($cmd,'r')); // Start detatched process <br />
&lt;/pre&gt;<br />
and uncomment as shown below<br />
&lt;pre&gt;<br />
$cmd = 'start ..\..\usr\local\php\php-win.exe ..\..\plugins\dtdns_updater\dtdns_updater.php';<br />
pclose(popen($cmd,'r')); // Start detatched process <br />
&lt;/pre&gt;<br />
'''''Notes'':'''<br />
* When the server is first started Cron is run and the IP addreess updated if different<br />
* Every ten minuets Cron is run and the IP address are checked if different are updated.<br />
* Cron only runs when the servers are running however you can force an update using the batch file mentioned above.<br />
* Cron can be manually or automatically started see [[5.0-Nano: Portable Cron | '''next page''']] for details.<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
For a home web server the free account at DtDNS is ideal at least it gives you an opportunity to test their service. Perhaps it will encourage you to purchase a real domain and use some of their paid services.<br />
<br />
The next page looks at [[5.0-Nano: Portable Cron | '''Cron''']] in more detail.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Installation]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=LCC-win32:_Drupal_Cron&diff=4869LCC-win32: Drupal Cron2010-11-24T10:21:52Z<p>Upazixorys: </p>
<hr />
<div>=[http://upezobyxez.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Uc nav lcc-win32}}<br />
'''LCC Drupal Cron''' (Portable Cron)<br />
<br />
On the previous page I covered a simple delay program this page expands on that to produce a portable cron application targeted at Drupal. I covered how to use unidelay.exe to produce a generic cron application on [[Portable Cron | this page]] it is worth reading for background information.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Requirement ==<br />
Our program will periodically run the following system command line:<br />
&lt;pre&gt;<br />
udrive\usr\local\php\php.exe -n udrive\www\run_cron.php<br />
&lt;/pre&gt;<br />
It runs '''php.exe''' in CLI mode (switch '''-n''' prevents php.ini file being read), which in turn runs script '''run_cron.php''' located in the server web root folder www. This script contains a single line which runs Drupal’s '''cron.php''' script.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Proposed solution ==<br />
The above line can be hard-coded within a delay loop. Assumes a fixed time; a user will always install Drupal in the root folder www and location of the PHP executable will never change.<br />
<br />
=== Restrictive ===<br />
Hard coding makes the program very restrictive, suppose a user wishes to have a different delay or decides to install Drupal in a sub-folder named drupal or some other folder. The location of PHP executable is unlikely to change but is possible.<br />
<br />
=== Flexibility ===<br />
Remember we have the ability to pass parameters to our program making it much more flexible. If the above hard-coded variables are made '''defaults''' they can be '''overridden using parameters'''.<br />
<br />
Order of parameters passed to our program is important, what will a user most likely want to change. I would go for '''delay''' followed by '''path to Drupal''' the least likely will be the '''path to PHP''' unless a user has redesigned Uniform Server. However including it as a parameter increases flexibility.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Implementation ==<br />
The command line to run our program looks similar to the following:<br />
<br />
drupal_cron.exe delay path_to_drupal path_to_php<br />
<br />
You will notice I have given the program and parameters a name these can be used later within the program as variables. <br />
<br />
I will place one restriction; our program shall be located in folder “'''Uniform Server'''” or any folder above both php and drupal folders. This means the '''paths are relative''' to the location of our program. Makes it both easier to program and for a user to correctly name the paths.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Code flow ==<br />
This should be a flow diagram however a few words can express the intended idea and logic. It can be a pain, keep it short. <br />
<br />
*Start<br />
*Set defaults<br />
*If no delay parameter use default<br />
*If no path_to_drupal parameter use default<br />
*If no path_to_php parameter use default<br />
*Start loop<br />
*Delay<br />
*Run system command path_to_php\php.exe -n path_to_drupal\run_cron.php<br />
*Go to Start loop<br />
*End<br />
<br />
'''''[[#top | Top]]'''''<br />
== Coding ==<br />
From the above you can start coding. I tend to add loads of comments in the hope when re-read in the future I will understand it. Its all a mater of personal style the following is one coding solution:<br />
&lt;pre&gt;<br />
#include &lt;stdheaders.h&gt;<br />
#include &lt;windows.h&gt;<br />
#include &lt;io.h&gt;<br />
<br />
int main(int argc,char *argv[])<br />
{<br />
//== Variables<br />
int delay; // Delay required<br />
char path_to_drupal[80]=&quot;&quot;; // relative pat to Drupal<br />
char path_to_php[80]=&quot;&quot;; // relative path to php<br />
char error_message[200]=&quot;&quot;; // error message string<br />
char cmd_string[200]=&quot;&quot;; // command line string<br />
<br />
//== Default values<br />
int default_delay=600000; // 1000ms gives 1s delay<br />
// 600000 = 10 mins<br />
char default_path_to_drupal[80]=&quot;udrive\\www\\run_cron.php&quot;;<br />
char default_path_to_php[80]=&quot;udrive\\usr\\local\\php\\php.exe&quot;;<br />
<br />
//== Set variables according to parameter supplied ===================<br />
if(argc==1){ // No parameters<br />
delay = default_delay; // hence use defaults<br />
strcat(path_to_drupal, default_path_to_drupal);<br />
strcat(path_to_php, default_path_to_php);<br />
}<br />
<br />
if(argc==2){<br />
delay = default_delay * (int)atoi(argv[1]); // New delay required<br />
strcat(path_to_drupal, default_path_to_drupal); // All other use<br />
strcat(path_to_php, default_path_to_php); // defaults<br />
}<br />
<br />
if(argc==3){<br />
delay = default_delay * (int)atoi(argv[1]); // New delay required<br />
strcat(path_to_drupal, argv[2]); // New drupal path<br />
strcat(path_to_php, default_path_to_php); // Use default<br />
}<br />
<br />
if(argc==4){<br />
delay = default_delay * (int)atoi(argv[1]); // New delay required<br />
strcat(path_to_drupal, argv[2]); // New drupal path<br />
strcat(path_to_php, argv[3]); // New php path<br />
}<br />
//== End set vars =====================================================<br />
<br />
//== Check if files exists ============================================<br />
if( _access(path_to_drupal,0) !=0 ) // File not found alert user<br />
{<br />
strcat(error_message, path_to_drupal);<br />
strcat(error_message, &quot;\n\n File not found\n\n No action taken&quot;);<br />
MessageBox (NULL, error_message , &quot;Path to Drupal&quot;, 0);<br />
return 1; // Give up its not going to work<br />
}<br />
<br />
if( _access(path_to_php,0) !=0 ) // File not found alert user<br />
{<br />
strcat(error_message, path_to_php);<br />
strcat(error_message, &quot;\n\n File not found\n\n Noaction taken&quot;);<br />
MessageBox (NULL, error_message , &quot;Path to PHP&quot;, 0);<br />
return 1; // Give up its not going to work<br />
}<br />
<br />
//== End Check if files exists ============================================<br />
<br />
//== Build command string ==============================<br />
strcat(cmd_string, path_to_php);<br />
strcat(cmd_string, &quot; -n &quot;); // Prevents ini read<br />
strcat(cmd_string, path_to_drupal);<br />
//== End Build command string ==========================<br />
<br />
//== Infinite loop, run process hidden =====================<br />
while (1){ //loop forever<br />
_System(cmd_string, SW_HIDE); // Run hidden child process<br />
sleep(delay); // Delay for specified time<br />
}<br />
//== End Infinite loop, run process hidden ===================<br />
<br />
return 0; // Exit! Will never reach this point beause<br />
// process exrernally killed.<br />
}<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':''' If you are looking for particular functions check out LCC standard library. Click Help link (top right ) from the drop down menu you will find various help files including the standard library.<br />
<br />
The code is self-explanatory however there are a few things worthy of note.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== File existence ===<br />
<br />
It is possible to create your own function to check the existence of a file the code would look similar to this:<br />
&lt;pre&gt;<br />
bool file_exists(const char * filename)<br />
{<br />
FILE *fp;<br />
if (fp = fopen(filename, &quot;r&quot;))<br />
{<br />
fclose(fp);<br />
return true;<br />
}<br />
return false;<br />
}<br />
&lt;/pre&gt;<br />
This may in certain situations produce unreliable results hence its far better to use a function specifically designed for this task hence the reason for using this function:<br />
&lt;pre&gt;<br />
_access(path_to_drupal,0)<br />
&lt;/pre&gt;<br />
It returns &quot;0&quot; if the file exists otherwise it returns &quot;-1&quot; <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Command Window ===<br />
If you use the standard system command to run php.exe<br />
&lt;pre&gt;<br />
system(cmd_string)<br />
&lt;/pre&gt;<br />
a command window opens until the program executions ends. Although relatively fast it produces an annoying black screen flash.<br />
<br />
Ideally the program should be run in a hidden window hence the use of this function:<br />
&lt;pre&gt;<br />
_System(cmd_string, SW_HIDE)<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
== Creating a new LCC project ==<br />
On the previous page I used different names for the project folder and executable it makes it slightly easier to create a new project if the names are identical. I will be creating the following project drupal_cron<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Create Project ===<br />
# Start LCC<br />
# Close any open projects: '''Project &gt; Close''' click '''Yes''' to confirm<br />
# Create project: '''Project &gt; Create''' opens '''Definition of new project''' window<br />
## Name of the new project: Enter '''drupal_cron'''<br />
## Sources: Click '''Browse''' navigate to E:'''\lcc\projects''' click '''OK''' add '''\drupal_cron''' to give '''E:\lcc\projects\drupal_cron'''<br />
## Output directory: '''Click in''' this window '''automatically updates''' to give '''E:\lcc\projects\drupal_cron\lcc'''<br />
## Type of project: Radio button defaults to Console Application leave selected<br />
## Click '''Create''' (button top right) <br />
# Do you want to use the wizard to generate the application skeleton: Click '''Yes'''<br />
# Application characteristics displayed: Click '''OK''' click '''OK''' to Lcc wizard pop-up<br />
# Compiler settings displayed: Click '''Next'''<br />
# Linker settings displayed: Click '''Next'''<br />
# Debugger settings displayed: Click '''Finish'''<br />
<br />
Project page drupal_cron.c will be displayed<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Edit Code ===<br />
# Delete everything in '''drupal_cron.c'''<br />
# '''Copy''' the above code into '''drupal_cron.c'''<br />
# '''File &gt; Save'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Test for errors ===<br />
# '''Compiler &gt; Make''' There should be no errors<br />
# '''Compiler &gt; Execute drupal_cron.exe''' Path to Drupal pop file not found - Indicates its working<br />
# Create the following folder chain: E:\lcc\projects\drupal_cron\lcc\'''udrive\www'''<br />
# In folder www create a blank file named '''run_cron.php'''<br />
# '''Compiler &gt; Execute drupal_cron.exe''' Path to PHP pop file not found - Indicates its working <br />
<br />
Note: You can create a similar path to php and use a dummy file. <br />
The program is working lets create the final code.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Configuration ===<br />
# '''Project &gt; Configuration''' opens configuration window.<br />
# Click Compiler tab and set the following:<br />
## '''Check''' Optimise<br />
## '''Check''' Eliminate unused assignments<br />
## '''UnCheck''' Generate debug info<br />
# Click Linker tab and set the following:<br />
## Type of output: Click in '''Windows appl radio button'''<br />
## Click '''OK''' Allow to rebuild '''OK''', Ignore any errors click '''OK'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Compile ===<br />
# Compiler &gt; Make<br />
# Compiler &gt; Compile drupal_cron.c<br />
# Pick-up the finished program '''drupal_cron.exe''' in '''E:\lcc\projects\drupal_cron\lcc'''<br />
# Copy this file to &quot;Uniform Server&quot;<br />
<br />
'''''[[#top | Top]]'''''<br />
== Other files ==<br />
To recap I have assumed Drupal has been installed in the root folder www.<br />
<br />
=== Uniform Server ===<br />
The folder &quot;Uuiform Server&quot; contains the following files:<br />
<br />
*'''drupal_cron.exe'''<br />
<br />
You can directly run this file if you have set the defaults to meet your requirements.<br />
<br />
*'''drupal_cron.bat'''<br />
<br />
Alternatively you can start '''drupal_cron.exe''' using a batch file and pass parameters to it.<br />
For example create '''drupal_cron.bat''' and add this line:<br />
<br />
&lt;pre&gt;<br />
start drupal_cron.exe 1 udrive\www\run_cron.php udrive\usr\local\php\php.exe<br />
&lt;/pre&gt; <br />
The above would have no effect since the parameters passed are the defaults.<br />
<br />
If you want to change the delay to 1 hour and installed Drupal to sub-folder www\drupal the batch file now looks like this:<br />
&lt;pre&gt;<br />
start drupal_cron.exe 6 udrive\www\drupal\run_cron.php <br />
&lt;/pre&gt;<br />
<br />
*'''stop_drupal_cron.bat'''<br />
<br />
If you want to manually stop drupal_cron.exe without relaying on turning your PC off create a batch file named '''stop_drupal_cron.bat''' and add the following line:<br />
<br />
&lt;pre&gt;<br />
udrive\home\admin\program\pskill.exe drupal_cron.exe c<br />
&lt;/pre&gt;<br />
<br />
=== Drupal root folder ===<br />
Drupal's root folder (where file cron.php is located) must contain the following PHP script file.<br />
Create a new file '''run_cron.php''' and add the following line:<br />
&lt;pre&gt;<br />
&lt;? $dummy = file(&quot;http://localhost/cron.php&quot;); ?&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
== Alternative start and stop ==<br />
An alternative to using separate batch files to start and stop drupal_cron.exe is to add the appriate line of code to the end of Uniform Server's start and stop files.<br />
<br />
Note: At the bottom of each file you will see ''':END''' add the one liner below this.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
If you have never considered using Drupal now you have a good excuse to try it. You can install it on a separate Uniform Server fire it up and have a play. Add your new compiled script and check it works.<br />
<br />
Real point of the above is to provide real working code that can be compiled with lcc. At first sight it looks difficult to use, this invariably is down to knowing where to start. I hope this page and the pervious ones have pointed you in the right direction. I have noticed over the years fancy programming language come and go but C remains there in a prominent position.<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Oily Rag]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Admin_Panel_2:_Private_Server_Configuration&diff=4864Admin Panel 2: Private Server Configuration2010-11-24T10:21:20Z<p>Upazixorys: </p>
<hr />
<div>=[http://atosaca.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc_nav_apanel2}}<br />
This page allows you to set-up a username and password making your web page server private (restricts access to the root folder www). To use this feature you need to activate it in the file /www/.htaccess I have provided a detailed description how to do this see below.<br />
<br />
'''Defaults'''<br />
<br />
&lt;table border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;&lt;strong&gt;Default value&lt;/strong&gt;&lt;/td&gt;<br />
&lt;td&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#DADADA&quot;&gt;Username:&lt;/td&gt;<br />
&lt;td bgcolor=&quot;#DADADA&quot;&gt;&lt;strong&gt;root&lt;/strong&gt;&lt;/td&gt;<br />
&lt;td bgcolor=&quot;#FFFFFF&quot;&gt;This form displays current settings, which is &amp;#8220;root&amp;#8221; for<br />
both name and password.&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#DADADA&quot;&gt;Password:&lt;/td&gt;<br />
&lt;td bgcolor=&quot;#DADADA&quot;&gt;&lt;strong&gt;root&lt;/strong&gt;&lt;/td&gt;<br />
&lt;td&gt;When you choose your own make sure they are different. &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
After saving your user name/password pair you can find them in file '''.htpasswd''' this file is located in folder '''*\Uniform Server\udrive\htpasswd\www'''<br />
<br />
'''''[[#top | Top]]'''''<br />
== Security ==<br />
A very important point to note, for security reasons folder '''htpasswd''' is placed '''outside''' of the '''root''' folder '''www'''. Apache only serves data from designed root folders UniServer’s default installation has one public root folder www; hence apanel's name and password cannot be severed to the Internet.<br />
<br />
== Automatic protection - Web page server ==<br />
Uniform Server serves web pages from the root folder www (*\Uniform Server\udrive\www) it contains a special file named '''.htaccess''' This protects the root folder and all folders and files below it. The default Apache command settings within this file restrict access to localhost. The name/password pair set above have no effect until enabled in the .htaccess file see below.<br />
<br />
== Name/password pair access ==<br />
Enabling Apache commands in .htaccess you can force a user on your machine (or Internet) to enter a name and password to gain access to pages on your server.<br />
<br />
You can add your own Apache commands to this file. The file provided splits into three main sections, understanding their interaction is important especially when you want to put your servers on-line or make your server private.<br />
<br />
'''''[[#top | Top]]'''''<br />
== .htaccess - Private or public server ==<br />
The remainder of this section looks at the file .htaccess in more detail. It is a text file; to edit open in any text editor but never use a word processor they add special characters and screw text files up badly.<br />
<br />
Uniform Server uses several .htaccess files, each protecting a particular area of the server. This one protects your web-site and can be found in folder: *\Uniform Server\udrive\www<br />
<br />
The file looks like this:<br />
<br />
&lt;pre&gt;<br />
# This file provides security to the server limiting access to the localhost only. <br />
# Comment to deactivate.<br />
<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
<br />
# To allow execution of cgi scripts in this directory uncomment next two lines.<br />
<br />
AddHandler cgi-script .pl .cgi<br />
Options +ExecCGI<br />
<br />
#--<br />
# Activate this to use the Private Server Feature!<br />
#--<br />
# To lock server, uncomment the next 4 lines.<br />
# Defaults: Username - root; Password - root<br />
<br />
#AuthName &quot;Uniform Server - Server Access&quot;<br />
#AuthType Basic<br />
#AuthUserFile /htpasswd/www/.htpasswd<br />
#Require valid-user<br />
&lt;/pre&gt;<br />
I have split the above into three sections, describing each section in detail at the end I combined all three section.<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Public Server ===<br />
To create a public server the quickest but not the best way is to delete the htaccess file. This removes any restrictions imposed, anyone on the Internet or local network can access all the folders and files in the root folder www.<br />
<br />
Deleting the htaccess file is a bit draconian you loose flexibly and control for example lets look at the first section of this file. <br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only.&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;<br />
<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;Order Deny,Allow&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;Deny from all&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;Allow from 127.0.0.1&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 1)''' The last three lines are commented this means they are inactive and not protecting the folder or its sub-folders<br />
<br />
If this was the only section it has the same effect as deleting the file.<br />
<br />
Alternatively you could delete all lines in this section the effect would still remain the same.<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
My real point using just three comments you have put your server online, remove the comments and you are back to square one, its that flexibility I am talking about. Delete the lines next time you wish to use them you may have to look up the format for the commands. Lets look at those three lines in more detail.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Localhost ===<br />
The securest way to develop a web-site is to run the servers with localhost access only (UniServer’s default) note the last three lines in section one shown below are uncommented making them active. These three Apache instructions are what I would call a '''cosey little group''' meaning you will always find then arranged this way.<br />
<br />
The first line states that the next two instructions will be executed in this order '''Deny''' and then '''Allow'''. If you had <br />
twenty Allow instruction followed by one Deny all those Allow instructions would be ignored and the Deny would be executed. Apache would then look for the first occurrence of Allow and execute it.<br />
<br />
You must have that first line. It is normal practice to write the next two instructions in the order stated.<br />
<br />
'''Deny''' from all, means just that no one has access to the Apache server.<br />
Now we make one exception '''Allow''' from port '''127.0.0.1''' this is '''localhost IP adress''' (the PC that Apache is running on)<br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only.&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;<br />
<br />
Order Deny,Allow&lt;br&gt;<br />
Deny from all&lt;br&gt;<br />
Allow from 127.0.0.1&lt;br&gt;<br />
<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 1)''' The last three lines are uncommented this means they are active and protecting the folder, where .htacces resides and all its sub-folders<br />
<br />
a) Execute the next two commands in this order '''Deny''' and the '''Allow'''.&lt;br&gt;<br />
b) '''Deny from all''' No one allowed access to the Apache server&lt;br&gt;<br />
c) '''Allow from 127.0.0.1''' Localhost is the only exception and allowed access.&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Script execution ===<br />
All root folders by default are not allowed to run cgi scripts. In order to run scripts you need to inform Apache accordingly the two lines in htaccess section 2 do this.<br />
<br />
Apache has no concept of user file extensions your Perl scripts could have the extension .plug, .zap or whatever. To cater for this Apache has a number of small helper programs that handle this situation. The '''handler program''' for cgi scripts is named “'''cgi-script'''” you pass information to this program by following the name with the file extensions that you are using for your scripts. For example '''cgi-script .zap .pl''' the handler program informs Apache that these files are cgi scripts and to be treated accordingly.<br />
<br />
To run the handler program it needs adding to Apache using the command '''AddHandler'''. As a user you need to inform Apache what you want to do with the scripts. You have two options either to run or not run the scripts.<br />
<br />
To allow execution of scripts you use the following option +ExecCGI the default is –ExecCGI <br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To disallow execution of cgi scripts in this directory comment next two lines.&lt;br&gt;<br />
<br />
AddHandler cgi-script .bat .exe .pl .cgi&lt;br&gt;<br />
Options +ExecCGI&lt;br&gt;<br />
<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 2)''' Allows scripts execution<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To disallow execution of cgi scripts in this directory comment next two lines.&lt;br&gt;<br />
<br />
# AddHandler cgi-script .bat .exe .pl .cgi&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Options +ExecCGI&lt;br&gt;<br />
<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 2)''' Comment the lines as shown to disable script execution<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Name Password Protection ===<br />
The final section of htaccess deals with user name and password protection by default this is disabled. If you have put your servers online (see section 1) anyone on the Internet can view your web site. If you have restricted your server to localhost (default) anyone with access (physical) to your PC can view your web site. <br />
<br />
&lt;table style=&quot;background-color:#ff0000&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#B5B5B5&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;<br />
<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthType Basic&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;Require valid-user&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 3)''' Comment to disable user name password access to your web site default setting on installing UniServer.<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
Uncomment the last four lines to enable password protection. Any user trying to view your web site will be requested to enter a name and password. This is the name/password pair you entered for your personal server.<br />
<br />
Please note this section is independent of the settings in section one hence authentication will be required.<br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#A8A8A8&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;<br />
<br />
AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;<br />
AuthType Basic&lt;br&gt;<br />
AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;<br />
Require valid-user&lt;br&gt;<br />
<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 3)''' Uncomment last four lines as shown to enable user name password protection.<br />
<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
The first line AuthName &quot;Uniform Server - Secure Server Access&quot; contains text that is displayed in the authentication required pop-up window, change this to match your web site.<br />
<br />
[[Image:Uc_password.gif]]<br />
:* '''AuthType Basic''' - The name and password are not saved encrypted plain text is used hence why they are not stored in the root folder.<br />
:* '''AuthUserFile /htpasswd/www/.htpasswd''' - This is the path to your password file and informs Apache where to find it.<br />
:* '''Require valid-user''' - This informs Apache authentication must be used to access this folder (apanel's pages).<br />
<br />
'''Note:''' Its not just the root folder that is protected all folders and files within it are protected. Typing any page name directly into a browser that is within your site will require authentication for first time access.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary - Private Server ==<br />
The complete htaccess file is shown below. It is currently configure to allow localhost access (section 1), to run cgi scripts (section 2) and require user authentication (section 3).<br />
<br />
&lt;table style=&quot;background-color:#00ff00&quot; width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot;&gt;<br />
&lt;tr bgcolor=&quot;#A8A8A8&quot;&gt;<br />
&lt;td colspan=&quot;2&quot;&gt;&lt;div align=&quot;center&quot;&gt;File '''.htaccess''' Located in folder '''*\Uniform Server\udrive\www'''&lt;/div&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#B5B5B5&quot;&gt;'''''Code'''''&lt;/td&gt;<br />
&lt;td width=&quot;50%&quot; bgcolor=&quot;#A8A8A8&quot;&gt;'''''Comment'''''&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; This file provides security to the server limiting access to the localhost only. &lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Comment to deactivate.&lt;br&gt;<br />
<br />
Order Deny,Allow&lt;br&gt;<br />
Deny from all&lt;br&gt;<br />
Allow from 127.0.0.1&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 1)''' To put your servers online comment the last three line in this section.<br />
<br />
The default setting is for localhost access, you can remain connected to the Internet only your local browser will be able to view and access your web-site server.<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#dadada&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To allow execution of cgi scripts in this directory uncomment next two lines.&lt;br&gt;<br />
<br />
AddHandler cgi-script .pl .cgi&lt;br&gt;<br />
Options +ExecCGI&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#dadada&quot;&gt;<br />
'''Section 2)''' The default is to allow execution of scripts.<br />
<br />
If you do not runs CGI scripts comment out the last two lines in this section.<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td bgcolor=&quot;#CCCCCC&quot;&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Activate this to use the Private Server Feature!&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;--&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; To lock server, uncomment the next 4 lines.&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt; Defaults: Username - root; Password - root&lt;br&gt;<br />
<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthName &quot;Uniform Server - Server Access&quot;&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthType Basic&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;AuthUserFile /htpasswd/www/.htpasswd&lt;br&gt;<br />
&lt;nowiki&gt;#&lt;/nowiki&gt;Require valid-user&lt;br&gt;<br />
&lt;/td&gt;<br />
&lt;td valign=&quot;top&quot; bgcolor=&quot;#CCCCCC&quot;&gt;<br />
'''Section 3)''' For a personal web server the last four lines have been uncommented. To access your web site a user must supply coreect user name and password.<br />
<br />
To disable this comment the last four lines. This allows every one access with the restriction set in section 1)<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: About]]<br />
[[Category: Facts]]<br />
[[Category: Troubleshooting]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=5.0-Nano:_Security_features&diff=48625.0-Nano: Security features2010-11-24T10:21:01Z<p>Upazixorys: </p>
<hr />
<div>=[http://yhenaju.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Nav 5.0-Nano}}<br />
'''Security features - Security Center'''<br />
<br />
Regarding security Apanel provides two pages of importance '''Home''' (initial opening page) and '''Security Center''' at first sight they look intimidating and give the impression Uniform Server is insecure especially with all those red links on each page. <br />
<br />
Before continuing I must stress Uniform Server is locked down allowing local access only. If connected to the Internet or Intranet the servers are inaccessible hence are '''very secure'''. This configuration is ideal when using Uniform Server as a development server but pretty useless for a production Web server (Well! No one can view your Web site).<br />
<br />
If you are not indenting to put the servers on-line you can safely ignore the above two pages. Even with your servers on-line most of these warnings can be ignored with one exception '''always''' set the '''MySQL password'''.<br />
<br />
Its import to understand Uniform Server security features you will then appreciate these pages provide reminders that you have not set something correctly.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Home page ==<br />
At the bottom of this page you are presented with a Security Checklist<br />
<br />
* Change the username/password for the Admin Panel here<br />
* Change the username/password for the server here<br />
* Change the username/password for the SSL server here<br />
* Change the root password for mysql by editing here<br />
* Run the Security Console and see if everything is OK.<br />
<br />
This is a reminder that all the usernames and passwords contain their defaults values which is ”'''root'''”<br />
<br />
With the exception of MySQL password there is '''no need to worry''' about these until you enable a server feature that uses them.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Change MySQL Password ===<br />
Now would be a good time to change the MySQL password, click the '''here''' link. This opens '''MySQL Server Configuration''' page. It displays the current MySQL password '''root''' change this to a new value and click '''Change''' a confirmation page is displayed. Return to the '''Home page''' the checklist entry for MySQL password has been removed confirming you are not using the default.<br />
<br />
If you had viewed the '''security center''' page first under '''User Management Security''' the link to the right of '''MySQL Server''' would have displayed '''unsecure'''. Clicking this link would have taken you to the '''MySQL Server Configuration''' page. After changing the password it displays '''secure''' <br />
<br />
'''''Note 1'':''' The new password takes effect immediately however I would recommend stopping the servers and closing your browser. This removes any potential problems associated with sessions and browser cache. <br />
<br />
'''''Note 2'':''' The remaining list of entries for name/password; function in a similar way, once changed, are removed from the list and the corresponding link on the '''security center''' page changes accordingly.<br />
<br />
You can work down this list and change the name/password pairs; they have no effect until you enable a particular server feature, covered further down this page.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Security Center ==<br />
This page is accessed either from the '''Home''' page or the left menu link '''Server Security'''<br />
<br />
It summaries the server security status for enabled features and provides additional information. <br />
<br />
=== User Management Security ===<br />
Under this (first) section there are five entries as follows:<br />
<br />
# Admin Panel username/password <br />
# Personal Server username/password <br />
# Personal Secure Server (SSL) username/password <br />
# Server Certificate and Key (SSL) Unsecure indicates no server certificate <br />
# MySQL Server password<br />
<br />
To the right of these you will see either '''Secure''' indicating that option has been enabled or a link named '''Unsecure''' indicating that option has not been enabled. The link offers a short cut to enable that option if you wish to do so. <br />
<br />
I have covered the MySQL password this sets the MySQL password for '''user root'''. The first three entries just set a name/password pair. These do not become effective until the corresponding feature has been enabled see next section.<br />
<br />
The fourth entry '''Server Certificate and Key (SSL)''' enables the SSL server. A new server Certificate and key are created this enables the SSL server; for full details check out [[5.0-Nano: Enable SSL |Enable SSL]]<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Server Security ===<br />
Under this (second) section there are five entries as follows:<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Local View ====<br />
{| cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;width:80%;background:#000000;&quot;<br />
|-<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
Due to the fact that some PC's have a different hostname set rather than localhost, we use the IP method here. This checks to make sure that you are viewing the Admin Panel (this) from local.<br />
|}<br />
Requires no explanation.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== PHP Safe Mode ====<br />
{| cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;width:80%;background:#000000;&quot;<br />
|-<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
This checks to see if PHP is running in SAFE MODE. Now, PHP does not have to run in SAFE MODE, but if you want the extra security, you can set it by clicking on the UNSECURE link.<br />
|}<br />
The explanation is clear just want to add that some third party scripts will not run if safe mode enabled. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Admin Panel Access ====<br />
{| cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;width:80%;background:#000000;&quot;<br />
|-<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
While this is another feature that is not throughly important as other features are in place against outside access to the Admin Panel, this checks to see if your Admin Panel is secured using the Auth method. Please change this by editing the C:/UniServer/home/admin/www/.htaccess file.<br />
|}<br />
Apanel is currently locked down for local access only. It is not name/password protected hence the '''Unsecure''' status.<br />
<br />
'''''Annoying'''''<br />
<br />
It really becomes annoying if you enable password protection when only local access is allowed.<br />
<br />
To prove my point edit file UniServer\home\admin\www\'''.htaccess'''<br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Uncomment the lines by removing the hash “#” as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
#AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
#AuthType Basic<br />
#AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
#Require valid-user<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
AuthType Basic<br />
AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
Require valid-user<br />
&lt;/pre&gt;<br />
|}<br />
Now every time you access Apanel you need to enter a name and password.<br />
<br />
'''''More annoying'''''<br />
<br />
What’s more annoying! Can you remember the name/password you entered for Admin Panel! I assumed you worked through the list mentioned on the Home page and forgot it.<br />
<br />
Well you have just enabled a '''feature''' that uses it and locked yourself out.<br />
<br />
Using Apanel you can view the current name/password pairs they are displayed in each set-up page however being locked out that’s not an option. You could disable the above lines which would give you access alternatively open this file UniServer\htpasswd\home\admin\www\'''.htpasswd''' to view current settings.<br />
<br />
One reason for showing this, notice the file path maps (home\admin\www\) to the location of the .htaccess file. This applies to the other password files.<br />
<br />
'''''Essential'''''<br />
<br />
'''''Note'':''' It is '''essential''' to enable this feature if you put Apanel on-line<br />
<br />
'''''[[#top | Top]]'''''<br />
===== Put Apanel on-line =====<br />
Although I never recommend this you can put Apanel on-line allowing access from either the Internet or Intranet. <br />
<br />
Edit file UniServer\home\admin\www\'''.htaccess'''<br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Disable local access only by commenting each line with an hash &quot;#&quot; as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Server Access ====<br />
{| cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;width:80%;background:#000000;&quot;<br />
|-<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
If you are running your server in Production Mode, Skip this one. If not and you would like to add more security to the server by blocking it using the Auth method, then change this in by editing the C:/UniServer/www/.htaccess file.<br />
|}<br />
Server (www) is currently locked down for local access only. It is not name/password protected hence the '''Unsecure''' status.<br />
<br />
'''''[[#top | Top]]'''''<br />
===== Put Server on-line =====<br />
Production server means you have put your server on-line to do this edit the following file: <br />
<br />
UniServer\www\'''.htaccess'''<br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Disable local access only by commenting each line with an hash &quot;#&quot; as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''Note'':''' No need to restart the server changes are Automatically picked up by Apache.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
===== Personal Server =====<br />
A personal server means you have restricted access using a name and password.<br />
<br />
To enable this feature edit file: UniServer\www\'''.htaccess''' <br />
<br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Uncomment the lines by removing the hash “#” as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
#AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
#AuthType Basic<br />
#AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
#Require valid-user<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
AuthType Basic<br />
AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
Require valid-user<br />
&lt;/pre&gt;<br />
|}<br />
Now every time a user browsers your server from either the Internet or Intranet is challenged for a name and password.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Server Access (SSL) ====<br />
{| cellpadding=&quot;6&quot; cellspacing=&quot;1&quot; style=&quot;width:80%;background:#000000;&quot;<br />
|-<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
If you are running your server in Production Mode, Skip this one. If not and you would like to add more security to the server by blocking it using the Auth method, then change this in by editing the C:/UniServer/ssl/.htaccess file. <br />
|}<br />
Server (ssl) is currently locked down for local access only. It is not name/password protected hence the '''Unsecure''' status.<br />
<br />
'''''[[#top | Top]]'''''<br />
===== Put Secure Server on-line =====<br />
Production server means you have put your server on-line to do this edit the following file: <br />
<br />
UniServer\ssl\'''.htaccess'''<br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Disable local access only by commenting each line with an hash &quot;#&quot; as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
|}<br />
'''''Note'':''' No need to restart the server changes are Automatically picked up by Apache.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
===== Personal Secure Server =====<br />
A personal secure server means you have restricted access using a name and password.<br />
<br />
To enable this feature edit file: UniServer\ssl\'''.htaccess''' <br />
{|<br />
|-<br />
|'''1)''' Locate these lines:||&amp;nbsp;||'''2''') Uncomment the lines by removing the hash “#” as shown<br />
|-<br />
|<br />
&lt;pre&gt;<br />
#AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
#AuthType Basic<br />
#AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
#Require valid-user<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|<br />
&lt;pre&gt;<br />
AuthName &quot;Uniform Server - Admin Panel 2.0&quot;<br />
AuthType Basic<br />
AuthUserFile C:/UniServer/htpasswd/home/admin/www/.htpasswd<br />
Require valid-user<br />
&lt;/pre&gt;<br />
|}<br />
Now every time a user browsers your server from either the Internet or Intranet is challanged for a name and password.<br />
<br />
'''''Note'':''' All data and name/password are encrypted before being sent.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
Security-center is a powerful Apanel feature, it collects all user configurable security options in one place. It acts as a reminder and provides short cuts (links) to change passwords. It also allows you to confirm you have enabled a security feature.<br />
<br />
The next page covers how to [[5.0-Nano: Enable SSL | enable SSL]] this has been fully integrated into 5.0-Nano making the whole process easy. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_CLI:_Recursive_Search_and_Replace&diff=4861PHP CLI: Recursive Search and Replace2010-11-24T10:20:37Z<p>Upazixorys: </p>
<hr />
<div>=[http://aluxyxenud.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Uc nav PHP CLI}}<br />
'''''PHP CLI Recursive Search and Replace'''''<br />
<br />
On the previous page I covered single file search and replace although adequate for most applications occasionally you will need to search a folder and its sub-folders for the files. Not a problem download one of the many classes that can be found on the Internet.<br />
<br />
I find they come with too many bells and whistles hence this page covers a basic PHP script to search and replace text in files in any folder and its sub-folders using a recursive function. <br />
<br />
By now you will appreciate I like working code examples these you can hack around and tailor to your own applications. In keeping with this the following examples take a look at problems associated with a recursive design using PHP.<br />
<br />
== Initial test setup ==<br />
Edit our two test files '''Run.bat''' and '''test_1.php''' contained in folder UniServer to have the following content:<br />
{|<br />
|-<br />
|<br />
'''''Run.bat'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
TITLE CLI TEST BAT<br />
COLOR B0<br />
@echo off<br />
cls<br />
echo.<br />
usr\local\php\php.exe -n test_1.php<br />
echo.<br />
pause<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
Batch file to run test_1.php script<br />
<br />
'''''Note 1'':''' UniServer Mona users change paths as shown:<br />
<br />
* '''udrive\'''usr\local\php\php.exe -n test_1.php<br />
* ./'''udrive/'''usr/local/mysql<br />
All scripts on this page will require the above change.<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$sfolder = &quot;./usr/local/mysql&quot;; // Start folder<br />
<br />
$Array=recur_dir($sfolder); // Retrieve file list<br />
<br />
foreach($Array as $line){ // Print list<br />
echo $line.&quot;\n&quot;;<br />
}<br />
<br />
//=== Recursive Directory ==============================================<br />
<br />
function recur_dir($dir){<br />
<br />
$dirlist = opendir($dir); // Open start directory<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
$newpath = $dir.'/'.$file; // Create path. Either dir or file <br />
$Array[]= $newpath; // Save full file path to array<br />
}<br />
<br />
closedir($dirlist); // Close handle <br />
return $Array; // Return array of files for <br />
} // further processing<br />
//========================================== END Recursive Directory =====<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
* First line sets the initial starting folder in variable '''$sfolder'''<br />
* Next line calls the recursive function and saves the returned list of files in array '''$Array'''<br />
* The '''foreach()''' function iterates through the array calling preg_replace() function however in this case just prints the list of files.<br />
'''''Recursive function'':'''<br />
* The recursive function takes as parameter the starting directory '''$dir''' <br />
* opendir() opens a handle to the starting directory and saves it in variable $dirlist <br />
* readdir() function returns a single entry from the currently open directory and saves it in variable $file.&lt;br&gt;'''''Note'':''' The returned value is either name of a directory or name of a file including its file extension.<br />
* The while loop is use to read every single entry in the open directory until there are no more entries to read.<br />
* Inside the while loop the full path is assembled and assigned to variable '''$newpath'''. This is added to the array '''$Array[]'''<br />
* With no more data to read we drop out of the while loop and close file handle closedir($dirlist). The file list $Array is returned to the caller.<br />
|}<br />
Run the batch file (double click on '''Run.bat''') Result as follows:<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
./usr/local/mysql/.<br />
./usr/local/mysql/..<br />
./usr/local/mysql/bin<br />
./usr/local/mysql/data<br />
./usr/local/mysql/my.cnf<br />
./usr/local/mysql/share<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
'''Well!''' What should be obvious there is no recursion, the code is only a starting point.<br />
<br />
The output contains a mixture of folders (bin, data, share) and files (my.cnf, mysqlrun.bat, mysqlstop.bat, README.txt)<br />
<br />
You will notice there are two special sub-directory names [.] and [..] these are normally hidden note that every folder contains them. A single period [.] means &quot;the current default directory.&quot; Two periods [..] means &quot;the directory which contains the current default directory&quot; also known as the parent directory. They are useful for navigation however will cause problems if not removed from a directory listing. <br />
<br />
|}<br />
'''''Note'':''' The above script is only a skeleton and needs refining.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Refine - Remove and separate ==<br />
The two special sub-folders need to be removed from any listings. Files and folders require separation. The following example is the next step before looking at recursion. <br />
<br />
Edit '''test_1.php''' to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$sfolder = &quot;./usr/local/mysql&quot;; // Start folder<br />
$Array=recur_dir($sfolder); // Retrieve file list<br />
<br />
foreach($Array as $line){ // Print list<br />
echo $line.&quot;\n&quot;;<br />
}<br />
//=== Recursive Directory ==============================================<br />
<br />
function recur_dir($dir){<br />
<br />
$dirlist = opendir($dir); // Open start directory<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
recur_dir($newpath); // yes: Repeat this function<br />
} // for that new folder<br />
else{ // no: Its a file<br />
$Array[]= $newpath; // Save full file path to array<br />
}<br />
<br />
}<br />
}<br />
closedir($dirlist); // Close handle <br />
return $Array; // Return array of files for <br />
} // further processing<br />
//========================================== END Recursive Directory =====<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
* Within the while loop first check for one of the special sub-folders. If not either of these contue otherwise skip. Let the while loop pick up another entry.<br />
* Using is_dir() function check to see if $newpath is a directory or file.<br />
* If it is a directory call the function '''recur_dir()''' with the new folder (calling itself is referred to as recursion)<br />
* Else it is a file save $newpath to $Array<br />
* The whole processes is repeated until there are no more entries to process.<br />
* Handle is closed using closedir($dirlist) and array returned to caller. <br />
'''''Run''''' the batch file (double click on '''Run.bat''') Result as follows:<br />
&lt;pre&gt;<br />
./udrive/usr/local/mysql/my.cnf<br />
&lt;/pre&gt;<br />
'''''Well what a pain''!'''<br />
<br />
What happened to the recursion?<br />
<br />
After all the function is calling it-self. <br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Modification ===<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
if (is_dir($newpath)){ // Is it a folder<br />
recur_dir($newpath); // yes: Repeat this function<br />
echo &quot;Path = &quot;.$newpath.&quot;\n&quot;;<br />
} // for that new folder<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
Add the '''echo''' line as shown to the above script.<br />
<br />
It prints out $newpath displaying any folders.<br />
<br />
Run the batch file.<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Result ===<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
<br />
Path = ./usr/local/mysql/bin<br />
Path = ./usr/local/mysql/data/mysql<br />
Path = ./usr/local/mysql/data/phpmyadmin<br />
Path = ./usr/local/mysql/data<br />
Path = ./usr/local/mysql/share/charsets<br />
Path = ./usr/local/mysql/share/english<br />
Path = ./usr/local/mysql/share<br />
<br />
./usr/local/mysql/my.cnf<br />
<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
An interesting result, it clearly shows recursion is taking place.<br />
<br />
For all sub-folders to be visible means all files must have been processed otherwise the script would have been stuck in the while loop.<br />
<br />
Why are only files in the starting directory listed?<br />
<br />
You may have noticed from the initial test setup all folders were listed firsts. This means the function is called before processing any files. The script works down a folder chain until no more folders are found then works back up the chain processing files. If it encounters a folder works down that folder chain. Net result the initial starting folder files are processed last.<br />
|}<br />
<br />
=== Solutions ===<br />
To answer the question local variables and local arrays are not retained between function calls. So very time the function calls it-self a new array is created and any previous data stored is lost. The solution is to use static arrays however these are supported only for classes hence why so many recursive solutions using classes.<br />
<br />
Another solution is to use a global array, its not neat because its detached from the function hence the need to remember its name and to clear it before use.<br />
<br />
A neater solution is to pass the array when calling the function; this keeps the array alive and data intacked see next example<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Refine - pass array back to function ==<br />
Solution is to pass the array back to the function during a recusre call as follows:<br />
<br />
Edit '''test_1.php''' to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$sfolder = &quot;./usr/local/mysql&quot;; // Start folder<br />
$Array=recur_dir($sfolder); // Retrieve file list<br />
<br />
foreach($Array as $line){ // Print list<br />
echo $line.&quot;\n&quot;;<br />
}<br />
//=== Recursive Directory ==============================================<br />
<br />
function recur_dir($dir,&amp;$Array){<br />
<br />
$dirlist = opendir($dir); // Open start directory<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
recur_dir($newpath,$Array); // yes: Repeat this function<br />
} // for that new folder<br />
else{ // no: Its a file<br />
$Array[]= $newpath; // Save full file path to array<br />
}<br />
<br />
}<br />
}<br />
closedir($dirlist); // Close handle <br />
return $Array; // Return array of files for <br />
} // further processing<br />
//========================================== END Recursive Directory =====<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
'''''Run''''' the batch file (double click on '''Run.bat''') Result as follows:<br />
<br />
'''''Warning'':''' Missing argument 2 for recur_dir(), called in ... test_1.php on line 3 and defined in ... test_1.php on line 10<br />
<br />
'''''Note'':''' List of all files including sub-folder files.<br />
<br />
Generally warnings are not an issue however this one is a pain and needs to be resolved. This warning occurs because of a parameter mismatch.<br />
<br />
We have seen this [[PHP CLI: User Input#Function variable parameters |'''before''']] the solution is to change this line:<br />
&lt;pre&gt;<br />
function recur_dir($dir,&amp;$Array){<br />
&lt;/pre&gt;<br />
'''To:'''<br />
&lt;pre&gt;<br />
function recur_dir($dir,&amp;$Array=false){<br />
&lt;/pre&gt;<br />
<br />
Initial call to function pass a single parameter.<br />
<br />
Recursive calls pass two parameters<br />
<br />
Essentially that’s it for recursion all that is required is to add some filtering see next section:<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Refine - Add file filtering ==<br />
Filtering files can be achieved using the function '''preg_match($pattern_regex, $string_to_search)'''<br />
<br />
The pattern was covered in [[PHP CLI: Files Search and Replace#preg_replace() - regex search|preg_replace()]] it has the following format ''''/regex_patern/''''<br />
<br />
Hence to filter files with a specific extension use something like this:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
'/(\.txt|\.cnf|\.conf)/'<br />
&lt;/pre&gt;<br />
|<br />
Pattern is delimited using ''''/'''' The entire regex is enclosed between brackets allowing the vertical bar (special character meaning or) to be used. The period (full stop) is a special regex character hence requires escaping using a backslash. <br />
|}<br />
<br />
== Final recursive file search ==<br />
Edit '''test_1.php''' to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$sfolder = &quot;./usr/local&quot;; // Start folder<br />
$File_list_array=recur_dir($sfolder); // Retrieve file list<br />
<br />
foreach($File_list_array as $line){ // Print list<br />
echo $line.&quot;\n&quot;;<br />
}<br />
//=== Recursive Directory ==============================================<br />
<br />
function recur_dir($dir,&amp;$Array=false){<br />
$f_str='/(\.txt|\.cnf|\.conf)/'; // Filter, required files<br />
<br />
$dirlist = opendir($dir); // Open start directory<br />
<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
recur_dir($newpath,$Array); // yes: Repeat this function<br />
} // for that new folder<br />
else{ // no: Its a file<br />
if (preg_match($f_str, $newpath)){ // Filter extension. Required files<br />
$Array[]= $newpath; // Save full file path to array<br />
} // includes file name<br />
}<br />
}<br />
}<br />
closedir($dirlist); // Close handle <br />
return $Array; // Return array of files for <br />
} // further processing<br />
<br />
//========================================== END Recursive Directory =====<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
* '''''Run''''' the batch file (double click on '''Run.bat''')<br />
* '''Result''' Only files with the specified extensions are listed.<br />
&lt;pre&gt;<br />
/(\.txt|\.cnf|\.conf)/<br />
&lt;/pre&gt;<br />
<br />
''Note 1'': The Start folder was moved allowing more folders to be to searched. Outside of the function changed $Array to $File_list_array to avoid confusion.<br />
<br />
'''''Note 2'':''' The array is passed to the function using the '''and''' operator '''&amp;'''$Array=false referred to as passing by pointer. It looks a little odd the array name is a pointer, however the array is not created until a value is assigned to it. If its not created it cannot be passed to the function for recursion. What the '''&amp;''' operator does is to create a variable to hold a pointer to the array. This will be created when the function is first called. <br />
<br />
File filtering is performed using preg_match() if a match found save the file to $Array<br />
&lt;pre&gt;<br />
if (preg_match($f_str, $newpath)){ <br />
$Array[]= $newpath; <br />
} <br />
&lt;/pre&gt;<br />
<br />
'''''Complete'':''' Essentially that completes the recursive file search template. You can now add replace code either externally to the function or convert it to perform both search and replace.<br />
|}<br />
Result of running the above script<br />
&lt;pre&gt;<br />
./usr/local/apache2/conf/httpd.conf<br />
./usr/local/apache2/conf/ssl.conf<br />
./usr/local/apache2/LICENSE.txt<br />
./usr/local/mysql/my.cnf<br />
&lt;/pre&gt;<br />
<br />
Press any key to continue . . .<br />
'''''[[#top | Top]]'''''<br />
<br />
== Search and replace example 1 ==<br />
Edit '''test_1.php''' to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$s_str = '/\nListen\s\d+/'; // String to search for<br />
$r_str = &quot;\nListen 8080&quot;; // Replacement string<br />
<br />
$sfolder = &quot;./usr/local&quot;; // Start folder<br />
$File_list_array=recur_dir($sfolder); // Retrieve file list<br />
<br />
<br />
foreach($File_list_array as $sfile){ // Scan file list<br />
$fh = fopen($sfile, 'r'); // Open file for read<br />
$Data = fread($fh, filesize($sfile)); // Read all data into variable<br />
fclose($fh); // close file handle<br />
<br />
$Data = preg_replace($s_str, $r_str, $Data); // Search and replace<br />
<br />
$fh = fopen($sfile, 'w'); // Open file for write<br />
fwrite($fh, $Data); // Write to file<br />
fclose($fh); // close file handle<br />
}<br />
//=== Recursive Directory ==============================================<br />
<br />
function recur_dir($dir,&amp;$Array=false){<br />
$f_str='/(\.txt|\.cnf|\.conf)/'; // Filter, required files<br />
<br />
$dirlist = opendir($dir); // Open start directory<br />
<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
recur_dir($newpath,$Array); // yes: Repeat this function<br />
} // for that new folder<br />
else{ // no: Its a file<br />
if (preg_match($f_str, $newpath)){ // Filter extension. Required files<br />
$Array[]= $newpath; // Save full file path to array<br />
} // includes file name<br />
}<br />
}<br />
}<br />
closedir($dirlist); // Close handle <br />
return $Array; // Return array of files for <br />
} // further processing<br />
<br />
//========================================== END Recursive Directory =====<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
To perform a global search and replace:<br />
* Set the file types you wish to match<br />
* Set a search string – regex format<br />
* Set a replacement string<br />
* Set a start folder<br />
* Run the recur_dir function to obtain a list of file.<br />
* Scan this list of files line-by-line for each file<br />
** Open the file<br />
** Perform search and replace using function preg_replace()<br />
** Close file<br />
* Repeat above steps for all files in the list<br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Search and replace example 2 ==<br />
The previous examples were designed to demonstrate certain concepts and potential issues during a recursive function design. Interestingly making the function what I refer to as self-contained most of the issues disappear.<br />
<br />
There was no real need to return a function containing a list of files, having found a matching file why not just perform a string search and replace. All that is required is to throw parameters at the function and let it get on with the job. This example does that I have also changed a few names to make them more meaningful.<br />
<br />
Edit '''test_1.php''' to have the following content:<br />
{|<br />
|-<br />
|'''''test_1.php'''''||&amp;nbsp;<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$start_dir = './usr/local'; // Start folder<br />
$file_type = '/(\.txt|\.cnf|\.conf)/'; // Filter, required files<br />
$search_str = '/\nListen\s\d+/'; // String to search for<br />
$replace_str = &quot;\nListen 8080&quot;; // Replacement string<br />
<br />
if(file_sr_global($start_dir,$file_type,$search_str,$replace_str)){<br />
echo &quot;\n Search and replace complete\n&quot;;<br />
}<br />
<br />
//=== Recursive File Search and replace =======================================<br />
<br />
function file_sr_global($start_dir,$file_type,$search_str,$replace_str){<br />
<br />
$dirlist = opendir($start_dir); // Open start directory<br />
<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $start_dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
// yes: Repeate this function<br />
file_sr_global($newpath,$file_type,$search_str,$replace_str); <br />
} // for that new folder<br />
else{ // no: Its a file<br />
if (preg_match($file_type, $newpath)){ // Filter extension. Required files<br />
<br />
$fh = fopen($newpath, 'r'); // Open file for read<br />
$Data = fread($fh, filesize($newpath)); // Read all data into variable<br />
fclose($fh); // close file handle<br />
<br />
$Data = preg_replace($search_str, $replace_str, $Data); // Search and replace<br />
<br />
$fh = fopen($newpath, 'w'); // Open file for write<br />
fwrite($fh, $Data); // Write to file<br />
fclose($fh); // close file handle<br />
echo $newpath.&quot;\n&quot;; //***** Delete this line ***************************<br />
} <br />
}<br />
}<br />
}<br />
closedir($dirlist); // Close handle <br />
return true; // Return <br />
} <br />
//=================================== END Recursive File Search and replace ===<br />
<br />
exit(0);<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
&lt;br&gt;<br />
To perform a global search and replace:<br />
* Set a folder to start the search from<br />
* Set the file types you wish to search<br />
* Set a search string – regex format<br />
* Set a replacement string<br />
* Pass these parameters to the function file_sr_global()<br />
<br />
Since the line:<br />
<br />
'''$Array[]= $newpath;''' has been replaced there is no feedback hence this test line:<br />
<br />
'''echo $newpath.&quot;\n&quot;;''' displays files that have been searched.<br />
<br />
After testing it can be removed.<br />
<br />
<br />
* '''''Run''''' the batch file (double click on '''Run.bat''')<br />
* '''Result''' Since it’s a powerful function I have restricted it to change only the '''Listen''' parameter in Apache’s configuration file. That said it '''still kills''' the server hence re-run script change this line:<br />
&lt;pre&gt;<br />
$replace_str = &quot;\nListen 8080&quot;;<br />
&lt;/pre&gt;<br />
To:<br />
&lt;pre&gt;<br />
$replace_str = &quot;\nListen 80&quot;;<br />
&lt;/pre&gt;<br />
Alternatively you can open the file and change it.<br />
<br />
There is one final step! Turn it into a finished function and use it.<br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Final recursive search and replace function ==<br />
One thing that really annoys me professional programmers that never documents one line of code, how do they know where it all fits in a few years time. I do tend to go overboard but that’s my personal preference. I know the above code is not perfect but at least you have some idea what each line does. Similarly when turned into a function I add extra information as follows:<br />
<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
//=== Recursive File Search and replace ==========================================<br />
// Inputs: $start_dir Absolute or relative path to starting folder. Do not<br />
// include a forward slash at the end. c:/test ./test <br />
// $file_type A regex patern containg file types to be searched <br />
// e.g. $file_type = '/(\.txt|\.cnf|\.conf)/' <br />
// $search_str A regex patern e.g $search_str = '/\nListen\s\d+/'<br />
// $replace_str A plain text string e.g. $replace_str = &quot;\nListen 8080&quot;<br />
//<br />
// Output: Returns true --- Need to add error checking<br />
// <br />
// Notes : Searches for files of the specified type starting at $start_dir and <br />
// incluse all sub-folders. Each file found a search and replace is<br />
// performed.<br />
// <br />
// -----------------------------------------------------------------------------------<br />
<br />
function file_sr_global($start_dir,$file_type,$search_str,$replace_str){<br />
<br />
$dirlist = opendir($start_dir); // Open start directory<br />
<br />
while ($file = readdir($dirlist)){ // Iterate through list<br />
if ($file != '.' &amp;&amp; $file != '..'){ // Skip if . or ..<br />
$newpath = $start_dir.'/'.$file; // Create path. Either dir or file <br />
<br />
if (is_dir($newpath)){ // Is it a folder<br />
// yes: Repeat this function<br />
file_sr_global($newpath,$file_type,$search_str,$replace_str); <br />
} // for that new folder<br />
else{ // no: Its a file<br />
if (preg_match($file_type, $newpath)){ // Filter by file extension.<br />
<br />
$fh = fopen($newpath, 'r'); // Open file for read<br />
$Data = fread($fh, filesize($newpath)); // Read all data into variable<br />
fclose($fh); // Close file handle<br />
<br />
$Data = preg_replace($search_str, $replace_str, $Data,-1,$count);// S &amp; R<br />
if($count){ // Was a replacement made<br />
$fh = fopen($newpath, 'w'); // yes: Open file for write<br />
fwrite($fh, $Data); // Write new $Data to file<br />
fclose($fh); // Close file handle<br />
echo $newpath.&quot; Replaced &quot;.$count.&quot;\n&quot;; //***** Delete this line *******<br />
}<br />
} <br />
}//eof else<br />
}<br />
}//eof while<br />
<br />
closedir($dirlist); // Close handle <br />
return true; // Return <br />
} <br />
//=================================== END Recursive File Search and replace ======<br />
&lt;/pre&gt;<br />
|}<br />
OK its true I never practice what I preach.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
To be honest I have never found any old fashioned PHP code to perform the above hence the reason for writing it, seems the trendy thing is classes. To justify this everyone wants to add far more than is required. I like simple! It’s less error prone. <br />
<br />
Well I am not biased in anyway and will hack any code if it gets the job done. This series has resulted in the creation of some original code.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Conclusion ==<br />
True objective of this tutorial series was to give you an insight into UniServer 5.0-Nano’s new control architecture. All examples in the tutorial can be found within this control architecture or support scripts.<br />
<br />
Esoteric batch files have been reduced to nothing more than interfaces to the PHP scripts. Uniform Server is now uniform regarding both scripting (control) and Web page language.<br />
<br />
This I hope will allow you to tailor the server to meet any specific functionality you require without the need to compile any code.<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || '''MPG''' (Ric)<br />
|}<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Stunnel:_Basics&diff=4857Stunnel: Basics2010-11-24T10:19:48Z<p>Upazixorys: </p>
<hr />
<div>=[http://etizupo.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Stunnel: <br />
[[Stunnel: Home | Home]] | <br />
[[Stunnel: Upgrade 4.24 | Upgrade 4.24]] | <br />
[[Stunnel: Install 4.24 | Install]] | <br />
[[Stunnel: SSL Certificate | SSL Certificate]] |<br />
[[Stunnel: Single Vhost | Single Vhost]] | <br />
[[Stunnel: Resolved | Resolved]] | <br />
[[Stunnel: Basics | Basics]] | <br />
[[Stunnel: Cost | Cost]] | <br />
[[Stunnel: Original | Original]] <br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''Stunnel SSL Basic'''<br />
|}<br />
Stunnel is very flexible this page provides additional information for Uniform Server 3.5-Apollo’s implementation. Stunnel is configured for server operation allowing a secure connection between Apache and a browser client.<br />
<br />
== SSL Basics ==<br />
Normal web pages are sent unencrypted over the Internet allowing anyone to intercept them and read their content. This presents a security issue where security and privacy is necessary for credit card and bank transactions. The Secure Socket Layer (SSL) is used to encrypt the data stream between the web server and a web browser.<br />
<br />
SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public the other private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring that the data only could have come from the server.<br />
<br />
A certificate is not really necessary because data is secure and cannot easily be decrypted. However, certificates do serve a crucial role in the communication process. The certificate, signed by a '''trusted Certificate Authority''' (CA), ensures that the certificate holder is really who he claims to be. Without a trusted signed certificate, your data may be encrypted, however, the party you are communicating with may not be whom you think.<br />
<br />
== Self-Signed Certificate ==<br />
You need to generate a self-signed certificate it contains the public key. UniServer’s Stunnel certificate is compromised because every one has access to it after downloading the plugin, this poses a security risk therefore you must generate a new certificate and key.<br />
<br />
If you don't plan on having your certificate signed by a CA it will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted [[Stunnel: Cost#Secure personal server | view screen shots]]. I am going to cover only self-signed certificate here. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Batch Generator ==<br />
To generate the certificate and public key you can use the command prompt and enter parameters manually. This is open to errors hence I created a batch file to ease the task.<br />
<br />
This batch file is named '''mpg_create.bat''' and located in folder '''&lt;nowiki&gt;*\Uniform Server\udrive\home\admin\www\plugins\stunnel_424\bin&lt;/nowiki&gt;'''<br />
<br />
{|style=&quot;border:1px solid #aaaaaa&quot;<br />
|-<br />
!style=&quot;background:#cccccc&quot;|<br />
mpg_create.bat<br />
|-<br />
|style=&quot;background:#f8f8f8&quot;|<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; File Name : mpg_create.bat&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Created By: UniCenter - MPG&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Create Stunnel pem certificate and public key file stunnel.pem&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Increased days to give 10year MPG 22/8/07 3.5-Apollo&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Updated to Stunnel 4.24 MPG 31/5/08&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Upgraded OpenSSL to openssl-0.9.8g MPG 31/5/08&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Updated for 3.5-Apollo MPG 18/8/07&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:&lt;/nowiki&gt; Version 1.1 18/8/07&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;:===============================================================&lt;/nowiki&gt;<br />
<br />
&amp;nbsp;openssl req -new -x509 -days 3650 -nodes -config stunnel.cnf -out stunnel.pem -keyout stunnel.pem<br />
<br />
&amp;nbsp;pause<br />
|}<br />
<br />
This batch file runs the program openssl with the following parameters. Create a certificate request ('''req''') that is '''new''' in the '''X.509''' digital certificate format, using the RSA cipher with a 1,024-bit key, good for '''3650''' days use the '''config''' file (stunnel.cnf) for additional information and write '''out''' both its key (private) and (public) certificate to the same file, '''stunnel.pem'''.<br />
<br />
'''''[[#top | Top]]'''''<br />
== stunnel.cnf ==<br />
Openssl is extremely flexible because of this flexibility requires a configuration file you can use any name so long as it ends with the file extension '''cnf''' Stunnel uses the file '''stunnel.cnf''' in this file you specify the type of certificate (in this case a server) encryption strength and other certificate details.<br />
<br />
The file stunnel.cnf is located in folder '''&lt;nowiki&gt;*\Uniform Server\udrive\home\admin\www\plugins\stunnel_424\bin&lt;/nowiki&gt;'''<br />
<br />
{|style=&quot;border:1px solid #aaaaaa&quot;<br />
|-<br />
!style=&quot;background:#cccccc&quot;|<br />
stunnel.cnf<br />
|-<br />
|style=&quot;background:#f8f8f8&quot;|<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; create RSA certs - Server<br />
<br />
&amp;nbsp;RANDFILE = stunnel.rnd<br />
<br />
&amp;nbsp;[ req ]&lt;br&gt;<br />
&amp;nbsp;default_bits = 1024&lt;br&gt;<br />
&amp;nbsp;encrypt_key = yes&lt;br&gt;<br />
&amp;nbsp;distinguished_name = req_dn&lt;br&gt;<br />
&amp;nbsp;x509_extensions = cert_type<br />
<br />
&amp;nbsp;[ req_dn ]&lt;br&gt;<br />
&amp;nbsp;'''countryName = Country Name (2 letter code''')&lt;br&gt;<br />
&amp;nbsp;countryName_default = PL&lt;br&gt;<br />
&amp;nbsp;countryName_min = 2&lt;br&gt;<br />
&amp;nbsp;countryName_max = 2<br />
<br />
&amp;nbsp;'''stateOrProvinceName = State or Province Name (full name)'''&lt;br&gt;<br />
&amp;nbsp;stateOrProvinceName_default = Some-State<br />
<br />
&amp;nbsp;'''localityName = Locality Name (eg, city)'''<br />
<br />
&amp;nbsp;'''0.organizationName = Organization Name (eg, company)'''&lt;br&gt;<br />
&amp;nbsp;0.organizationName_default = Stunnel Developers Ltd<br />
<br />
&amp;nbsp;organizationalUnitName = Organizational Unit Name (eg, section)&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt;organizationalUnitName_default =<br />
<br />
&amp;nbsp;'''0.commonName = Common Name (FQDN of your server)'''&lt;br&gt;<br />
&amp;nbsp;0.commonName_default = localhost<br />
<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; To create a certificate for more than one name uncomment:&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; 1.commonName = DNS alias of your server&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; 2.commonName = DNS alias of your server&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; ...&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; See &lt;nowiki&gt;http://home.netscape.com/eng/security/ssl_2.0_certificate.html&lt;/nowiki&gt;&lt;br&gt;<br />
&amp;nbsp;&lt;nowiki&gt;#&lt;/nowiki&gt; to see how Netscape understands commonName.<br />
<br />
&amp;nbsp;[ cert_type ]&lt;br&gt;<br />
&amp;nbsp;nsCertType = server<br />
|}<br />
<br />
When you run the batch file (mpg_create.bat) it runs openssl which reads this configuration file.<br />
<br />
'''''Note 1''''': All lines highlighted ('''bold''') are questions presented to you during certificate generation. If you press enter as a response the default value will be used otherwise the value you enter is used.<br />
<br />
When you reach the line fully qualified domain name (FQDN) enter your server's full name (the name you type in a browser to access your site without the &lt;nowiki&gt;http://&lt;/nowiki&gt; bit) or IP address of your server.<br />
<br />
'''''Note 2''''': FQDN example, given a device with a hostname of &quot;fred&quot; and a domain name of &quot;example.com&quot;, the fully qualified domain name is &quot;'''fred.example.com'''&quot; Like an IP address it is unique and removes any ambiguity.<br />
<br />
Note: Windows does not display the file extention ('''cnf''') hence file '''stunnel.cnf''' will display as s'''tunnel''' (the icon is a speed dial)<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Generating a certificate ==<br />
The batch file allows you to create both the private key and public key in one go. You can generate each file individually and then manually combine them into a single file in the PEM format. However using a batch file makes it just that little bit easier and less error prone.<br />
<br />
The file is located in folder: '''&lt;nowiki&gt;*&lt;/nowiki&gt;\Uniform Server\udrive\home\admin\www\plugins\stunnel_424\bin'''<br />
<br />
# If running shut down your servers.<br />
# To start the process double click on the batch file '''mpg_create.bat'''.<br />
# First the private key is automatically created and requires no input from you.<br />
# The next phase is a Certificate Signing Request (CSR).&lt;br&gt;During this generation process you will be prompted for several pieces of information. These are the X.509 attributes of the certificate.<br />
# I have highlighted in bold the type of information you enter.<br />
<br />
<br />
{|cellpadding=&quot;4&quot; <br />
|width=&quot;20&quot;|<br />
|style=&quot;background:#f8f8f8;border:1px solid #cccccc&quot;|<br />
Country Name (2 letter code) [PL]:'''UK'''&lt;br&gt;<br />
State or Province Name (full name) [Some-State]:'''Cambridgeshire'''&lt;br&gt;<br />
Locality Name (eg, city) []:Cambridge&lt;br&gt;<br />
Organization Name (eg, company) [Stunnel Developers Ltd]:'''Mike Gleaves UniCenter'''&lt;br&gt;<br />
Organizational Unit Name (eg, section) []:'''Uniform Server 3.5-Apollo example'''&lt;br&gt;<br />
Common Name (FQDN of your server) [127.0.0.1]:'''fred.gotdns.com'''&lt;br&gt;<br />
Press any key to continue<br />
|}<br />
<br />
You can repeat this process at any time, for a self-signed certificate the information you enter is unimportant with the exception of FQDN (fully qualified domain name) if you have one use it (its the full address you would enter in a browser apart from the &lt;nowiki&gt;http://&lt;/nowiki&gt; bit).<br />
<br />
'''''Note 1''''': A default value is displayed in square brackets press return to accept this value. If you are feeling lazy press return at each prompt. The resulting certificate is fully functional however it does not look very professional when displayed in a browser.<br />
<br />
'''''Note 2''''': '''The only thing of importance each certificate you generate is unique'''.<br />
<br />
It really is that easy to produce a self signed certificate to secure your personal server. If you want some background information take a look at this page SSL basics.<br />
<br />
'''''[[#top | Top]]'''''<br />
== stunnel.conf ==<br />
Stunnel also extremely flexible requires a configuration file amongst other things it sets Stunnels mode of operation either client or server mode. Uniform Server uses Stunnel's '''default server mode'''.<br />
<br />
The section that you may need to change is '''uniform35''' in this section you set '''accept''' and '''connect''' port values. These have been set to the standard ports values, if you change the Apache listening port change connect to match. If you wish to set the Internet secure port change accept to match this. (Note: You will also need to change your firewall and router forwarding ports)<br />
<br />
{|style=&quot;border:1px solid #aaaaaa&quot;<br />
|-<br />
!style=&quot;background:#cccccc&quot;|<br />
stunnel.conf<br />
|-<br />
|style=&quot;background:#f8f8f8&quot;|<br />
&amp;nbsp;; File Name : stunnel.conf&lt;br&gt;<br />
&amp;nbsp;; Created By: UniCenter - MPG&lt;br&gt;<br />
&amp;nbsp;; Updated to Stunnel 4.24 MPG 1/6/08&lt;br&gt;<br />
&amp;nbsp;; Added an addtional start file mpg_perl_php_start.bat&lt;br&gt;<br />
&amp;nbsp;; Updated to Stunnel 4.20 MPG 25/3/07&lt;br&gt;<br />
&amp;nbsp;; Updated for 3.5-Apollo MPG 20/8/07&lt;br&gt;<br />
&amp;nbsp;; Version 1.1 20/8/07&lt;br&gt;<br />
&amp;nbsp;; Notes:&lt;br&gt;<br />
&amp;nbsp;; Drive independent use mpg_stunnel_start.bat and mpg_stunnel_stop.bat&lt;br&gt;<br />
&amp;nbsp;; If not run from these files full path must be specified eg&lt;br&gt;<br />
&amp;nbsp;;cert = w:\home\admin\www\plugins\stunnel_424\bin\stunnel.pem&lt;br&gt;<br />
&amp;nbsp;;key = w:\home\admin\www\plugins\stunnel_424\bin\stunnel.pem&lt;br&gt;<br />
&amp;nbsp;; ========================================================================<br />
<br />
&amp;nbsp;cert = stunnel.pem&lt;br&gt;<br />
&amp;nbsp;key = stunnel.pem<br />
<br />
&amp;nbsp;ciphers = ALL:!ADH:RC4+RSA:+SSLv2:@STRENGTH&lt;br&gt;<br />
&amp;nbsp;;debug 5=notice 7= full debug&lt;br&gt;<br />
&amp;nbsp;debug = 5<br />
<br />
&amp;nbsp;RNDbytes = 64&lt;br&gt;<br />
&amp;nbsp;RNDoverwrite = yes&lt;br&gt;<br />
&amp;nbsp;session = 300 seconds&lt;br&gt;<br />
&amp;nbsp;verify = level 1<br />
<br />
&amp;nbsp;'''[uniform35]'''&lt;br&gt;<br />
&amp;nbsp;;htpps port 443&lt;br&gt;<br />
&amp;nbsp;accept = 443&lt;br&gt;<br />
&amp;nbsp;;default connects to local host&lt;br&gt;<br />
&amp;nbsp;connect = 80<br />
<br />
&amp;nbsp;TIMEOUTbusy = 300 seconds&lt;br&gt;<br />
&amp;nbsp;TIMEOUTclose = 60 seconds&lt;br&gt;<br />
&amp;nbsp;TIMEOUTidle = 43200 seconds<br />
|}<br />
<br />
'''''Note''''': You can disable the taskbar icon by adding the line: '''taskbar = no''' <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Application]]<br />
[[Category: Development]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Cron_Design:_Running_Cron&diff=4855Cron Design: Running Cron2010-11-24T10:19:35Z<p>Upazixorys: </p>
<hr />
<div>=[http://icucoja.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Nav Cron Design}}<br />
Both Cron start and stop requests are passed to a central control block for processing. This control block consists of two scripts '''start_servers.php''' and '''stop_servers.php''' these are located in folder UniServer\unicon\main. Further processing if required is handed on to the appropriate script or scripts.<br />
<br />
In terms of interfacing having a central control architecture provides consistency and reduces complexity. This page covers the Cron interface and control processing.<br />
<br />
== Binary coding ==<br />
Programs or batch files that run either of the control scripts '''start_servers.php''' or '''stop_servers.php''' must include a single binary coded parameter. If this parameter is missing defaults are used. A parameter overrides any default settings this allows independent control of a particular function.<br />
<br />
Currenty the following binary codes have been assigned:<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
<br />
CODE Options are binary coded as follows:<br />
Bit function<br />
Apache 1 1 - Run Apache server 0 - ignore<br />
Mysql 2 1 - Run MySQL server 0 - ignore<br />
Index page 4 1 - Start Index page 0 - ignore<br />
MySQL Console 8 1 - Display console 0 - ignore<br />
Cron 16 1 - Run cron 0 - ignore<br />
<br />
&lt;/pre&gt;<br />
|<br />
Binary bit coding does not conform to the classic definition where 1 means on and 0 means off. Uniform Server uses 1 to mean perform the function while 0 means ignore and do nothing.<br />
<br />
Having two separate files start_servers.php and stop_servers.php respectively performs the on-off functionality.<br />
<br />
Defaults are set in file UniServer\unicon\main\includes\'''config.inc.php''' by the following lines:<br />
<br />
* $server_standard = 7;<br />
* $server_service = 7;<br />
|}<br />
'''''What does this techno babble mean''!'''<br />
<br />
Well if you run start_servers.php with '''no parameter''' it picks up the default from variable '''$server_standard''' which has a value of '''binary code 7'''.<br />
<br />
Splitting code 7 into its individual components gives '''1+2+4''' hence '''start_servers.php''' runs the following processes:<br />
<br />
* 1 Apache<br />
* 2 Mysql<br />
* 4 Index page<br />
<br />
Similarly running '''stop_servers.php''' with no parameter will stop the above running processes. <br />
<br />
Using binary coding offers single bit (process) control this is exploited when running Cron explained below.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Running portable Cron ==<br />
With an understanding of the above we can look at running Cron in more detail.<br />
=== Manually ===<br />
Portable Cron is run from one of two locations.<br />
<br />
==== Alternative Control ====<br />
* Navigate to folder UniServer\alternative_control<br />
* To run Cron: Double click on Start_Cron.bat<br />
* To stop Cron: Double click on Stop_Cron.bat<br />
<br />
<br />
'''Start_Cron.bat''' contains the following line:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\start_servers.php 16<br />
&lt;/pre&gt;<br />
* '''..\usr\local\php\php.exe -n''' Runs the PHP interpreter ('''php.exe''') with no ('''-n''') configuration file and runs the following file: <br />
* '''..\unicon\main\start_servers.php 16''' Script start_servers.php is run with parameter 16 (Runs only Cron) <br />
<br />
<br />
'''Stop_Cron.bat''' contains the following line:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\stop_servers.php 16<br />
&lt;/pre&gt;<br />
* '''..\usr\local\php\php.exe -n''' Runs the PHP interpreter ('''php.exe''') with no ('''-n''') configuration file and runs the following file: <br />
* '''..\unicon\main\stop_servers.php 16''' Script stop_servers.php is run with parameter 16 (Stops only Cron) <br />
<br />
<br />
==== UniTray ====<br />
* Left or Right mouse click tray icon<br />
* To run Cron: Advanced &gt; Start Portable Cron<br />
* To stop Cron: Advanced &gt; Stop Portable Cron<br />
Have a peek inside Unitrays configuration file: UniServer\unicon\tray_menu\'''UniTray1.ini'''<br />
<br />
These two lines (split on purpose to prevent breaking the Wiki) control Cron start and stop. Only thing worth of note is they use binary code '''16'''<br />
&lt;pre&gt;<br />
Type: item; Caption: &quot;Start Portable Cron&quot;; Action: shellexecute; FileName:<br />
&quot;%PHP%\php-win.exe&quot;; Parameters: &quot; -n %ServerConMain%\start_servers.php 16&quot;; Glyph: 9<br />
<br />
<br />
Type: item; Caption: &quot;Stop Portable Cron&quot;; Action: shellexecute; FileName:<br />
&quot;%PHP%\php-win.exe&quot;; Parameters: &quot; -n %ServerConMain%\stop_servers.php 16&quot;; Glyph: 11<br />
<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Automatic ===<br />
Cron can be configured to run automatically when the servers are started.<br />
<br />
Edit file UniServer\unicon\tray_menu\'''UniTray1.ini'''<br />
<br />
These four lines (lines three and four split on purpose to prevent breaking the Wiki) control Server Start and Stop.<br />
<br />
Change binary code from 7 to 23 for lines three and four.<br />
&lt;pre&gt;<br />
;=== LEFT MENU ============<br />
[Menu.Left]<br />
<br />
Type: item; Caption: &quot;Start UniServer (Apache MySQL)&quot;; Action: shellexecute; FileName:<br />
&quot;%PHP%\php.exe&quot;; Parameters: &quot; -n %ServerConMain%\start_servers.php 7&quot;;ShowCmd: hidden; Glyph: 9<br />
<br />
Type: item; Caption: &quot;Stop UniServer (Apache MySQL)&quot;; Action: shellexecute; FileName:<br />
&quot;%PHP%\php.exe&quot;; Parameters: &quot; -n %ServerConMain%\stop_servers.php 7&quot;;ShowCmd: hidden; Glyph: 11<br />
&lt;/pre&gt;<br />
'''''[[#top | Top]]'''''<br />
<br />
== Cron Start Stop ==<br />
The control block consists of two scripts '''start_servers.php''' and '''stop_servers.php''' these are located in folder UniServer\unicon\main.<br />
<br />
When these scripts are run they process a parameter passed in the case of Cron they are looking for binary code 16.<br />
<br />
The appropriate sections are reproduce below along with a description of salient points.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== start_servers.php - Cron Section ===<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
* $server_operation contains either the parameter passed or default this is compared with binary 16 using the “binary &amp; bit operator” On a match runs the block of code.<br />
* If Apache not running give up<br />
* If Cron already running again give up<br />
* Cron tracker is used to break out of an infinite while loop (covered later) <br />
* Cron requires further process hence is handed over to a detached process.<br />
* The cmd is built. uniserv.exe is used to hide this detached process.<br />
* pclose(popen($cmd,'r')) runs script run_cron.php as a detached hidden process<br />
<br />
'''''Note 1'':''' For testing the command can be switch making the process visible.<br />
<br />
'''''Note 2'':''' If a user turns PC off without closing the servers next time servers are run a clean up operation is performed. Hence this code is run '''set_cron_tracker(&quot;stop&quot;)''' see RUN APACHE SERVER section <br />
|<br />
&amp;nbsp;<br />
|<br />
'''''start_servers.php'''''<br />
&lt;pre&gt;<br />
// === RUN CRON ============================================================<br />
if ((int)$server_operation &amp; 16 ){ // Cron enabled by config or parameter <br />
<br />
if(apache_running()){ // Only run cron if Apache running<br />
// otherwise ignore and exit quietly<br />
<br />
if(get_cron_tracker() == &quot;run&quot;){ // Cron already running<br />
print &quot; Cron already running\n&quot;; // Already running, give up<br />
}<br />
else{ // not running<br />
set_cron_tracker(&quot;run&quot;); // set tracker to run<br />
print &quot; Cron started \n&quot;; // inform user<br />
<br />
// Test switch between the two: visibe<br />
//$cmd = 'start ..\..\usr\local\php\php.exe run_cron.php'; // Test<br />
<br />
// Test switch between the two: hidden<br />
$cmd = 'start uniserv.exe &quot;..\..\usr\local\php\php.exe run_cron.php&quot;';<br />
<br />
pclose(popen($cmd,'r')); // Start detatched process <br />
<br />
}<br />
}//End Apache running<br />
}// End run cron<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== stop_servers.php - Cron Section ===<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
* $server_operation contains either the parameter passed or default this is compared with binary 16 using the “binary &amp; bit operator” On a match runs the block of code.<br />
* If Cron is running set the tracker to &quot;stop&quot;<br />
<br />
The cron script on detecting a tracker value of &quot;stop&quot; breaks out of an inifinatent while loop thus killing the process.<br />
|<br />
&amp;nbsp;<br />
|<br />
'''''stop_servers.php'''''<br />
&lt;pre&gt;<br />
<br />
// === Stop Cron ========================================================<br />
<br />
if ((int)$server_operation &amp; 16 ){ // Cron enabled by config or parameter<br />
if(get_cron_tracker() == &quot;stop&quot;){ // Already stopped or not running<br />
print &quot; Cron not running\n&quot;;<br />
}<br />
else{<br />
set_cron_tracker(&quot;stop&quot;); // Is running signal to stop<br />
print&quot; Cron stopped.\n&quot;; // Inform user<br />
}<br />
}<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
The above has explained how Cron integrates into Uniforms Servers control architecture and the selective nature of binary coding.<br />
<br />
A request to run Cron results in running a new detached process. Although a single script I have split it over a number of pages to explain each section in detail.<br />
<br />
[[Cron Design: Cron Script Part 1 |'''Next page''']] covers the fundamental building block, an infinite while loop.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=SSL_Part_2:_CAcert_Introduction&diff=4854SSL Part 2: CAcert Introduction2010-11-24T10:19:28Z<p>Upazixorys: </p>
<hr />
<div>=[http://uvetysudema.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
SSL Part 2: <br />
[[SSL Part 2: Home | Home]] | <br />
[[SSL Part 2: PC Lock Down | Lock Down]] | <br />
[[SSL Part 2: No IP | No IP]] | <br />
[[SSL Part 2: Installing hMailServer | hMailServer]] |<br />
[[SSL Part 2: Configure hMailServer | Config hMailServer]] | <br />
[[SSL Part 2: PHP mail function |PHP mail function]] | <br />
[[SSL Part 2: Generate CSR |Generate CSR]] | <br />
[[SSL Part 2: CAcert Introduction |CAcert]] | <br />
[[SSL Part 2: CAcert Signing Process |CAcert Signing Process]]<br />
<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''CAcert'''&lt;br&gt;'''Signed Certificate Project'''&lt;br&gt;Uniform Server 3.5-Apollo'''<br />
|}<br />
{|<br />
|-<br />
|<br />
[[Image:Uc_intro_cacert.gif]] <br />
|<br />
CAcert is a community driven '''C'''ertificate '''A'''uthority issuing '''free''' certificates with no hidden or implied charges. They are a worldwide team of professionals, fighting for individuals right to Internet security through the use of encryption.<br />
|}<br />
CAcert offer a wide range of certificates, for example you can obtain one for use with your email program to encrypt and prove to friends and family your email really does come from you. Ever wanted to protect your POP3, SMTP and IMAP connections then take a look at their site or perhaps you are after a wild card certificate they also have that covered.<br />
<br />
We are interested in server security and obtaining a server certificate, interestingly I came across a statement that they don't limit the strength of certificates, not true they do! OK the minimum strength you can request is 1024, upper limit is dictated by the processing power of an end user device for example a PDA’s ability to deal with a very strong encryption key of 4096 is probably too high.<br />
<br />
== Alternatives ==<br />
There are several alternatives search the Internet for free CA’s, two worth looking at are '''Thawte''' and '''Comodo'''. It’s difficult to make a recommendation always read the small print. In particular check the renewal period this can vary from three to six months. Everyone has different requirements hence worth doing a little research.<br />
<br />
== Validation ==<br />
For this write-up I choose '''CAcert''' their certificates are genuinely free and they force a '''rigorous validation''' system on you.<br />
<br />
That said the process is not difficult to use, it is fully automated, if you make a mistake no need to feel intimidated just have another go.<br />
<br />
The process really is easy to use however if you have problems that you cannot resolve send CAcert a support request. Don’t be surprised at a quick and friendly response that’s the way they work. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Process Overview ==<br />
For new users there are three steps required to obtain a signed certificate:<br />
<br />
# Join CAcert; fill in their online registration form. On successful completion an email will be sent to the address you supplied. To confirm you originated the request click the link contained in the email.<br />
# With your account active, login and register the domain name you require a certificate for. This requires you to have a mail server running at that domain address. Validation is performed using a mail probe. On detecting your mail server a conformation email is sent to that server’s email address. This email contains a link you must click within two days; you are taken to a secure page, complete the validation process by clicking on the confirmation link.<br />
# Obtaining a signed certificate is straightforward copy-paste your CSR into the on-line form. Click the submit button; your certificate is automatically signed and displayed, copy this certificate into your server certificate file (server.crt) that’s it done. A conformation email will be sent to your registration address.<br />
<br />
'''''Note 1'':''' Once you have registered you only need to repeat steps 2 and 3 for each domain you require a certificate for.<br />
<br />
'''''Note 2'':''' You are dealing with a Unix system that does not tolerate sloppy and insecure passwords give this some though before registration see details below. In addition the process assumes you run a Unix box and inherently have a mail server running hence the reason for installing hMailServer.<br />
<br />
'''''Note 3'':''' After updating your server certificate Apache requires re-starting to pick-up the new information.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Step 1) Join CAcert ==<br />
You can find CAcert at [http://www.cacert.org/ http://www.cacert.org/], to register click the “Join” link, top right of page.<br />
<br />
The concept of long random passwords (pass phrase) is probably alien to most Windows users don’t even think about something like fred123 because that will get you no where. A secure pass phrase is essential once you know what is required it’s not that difficult to create, follow the notes below and you should have no problems.<br />
<br />
Once the system accepts your form a conformation email will be sent to your registration email address. This email contains a link clicking it confirms acceptance and completes your registration.<br />
<br />
The following provides a little more detail:<br />
<br />
'''Registration form main fields'''<br />
{|<br />
|-<br />
|<br />
[[Image:Uc_1_cacert_reg_form.gif]]<br />
|valign=&quot;top&quot;|<br />
{|<br />
|-<br />
|<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!Comments regarding registration form<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
Creating a valid pass phrase is probably the most difficult part of registration for guidance they provide an example. The eight steps shown below will help in creating a valid pass phrase.<br />
<br />
Remainder of the form is straightforward and should not present a problem.<br />
<br />
If you cannot remember your pass phrase it can be retrieved. The system will present you with a question and answer scenario. It’s a random question taken from the five questions and responses you supply. Don’t go over the top keep them simple.<br />
|}<br />
|-<br />
|<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
!Password (Pass Phrase) <br />
|- style=&quot;background:#f5f5f5;&quot;<br />
|<br />
# Shall not contain your name or part of your name<br />
# Shall not contain your email or part of your email<br />
# Shall contain at least 1 lower case letter<br />
# Shall contain at least 1 upper case letter<br />
# Shall contain at least 1 space (hence the term phrase)<br />
# Shall contain at least one symbol<br />
# Shall not contain an English word<br />
# Shall have a minimum of 15 characters (30 or more ideal)<br />
|}<br />
|}<br />
|}<br />
<br />
'''''Note 1'':''' Your registration email address is used after successfully creating a signed certificate. A confirmation email is sent, you can ignore this or click the link to pick-up your certificate, I am sure you will have already copied your certificate! This email strikes me as an additional security feature, check the link and make sure it corresponds to a certificate you requested for signing if not contact CAcert immediately.<br />
<br />
'''''Note 2'':''' Important before signing-up please take time and read CAcert’s Privacy policy and Community Agreement as a member you need to known what your commitments and rights are. You are joining a professional organisation and they expect this to be precipitated, benefiting the community as a whole.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Step 2) Registering a domain ==<br />
A signed certificate contains one very important '''verifiable''' piece of information and that’s the '''domain name'''. A domain name is unique, CAcert verifies this using an email probe to access a mail server '''associated''' with that domain name. All domains you require a signed certificate for must first be verified, the following details that process.<br />
<br />
{|width=&quot;800&quot;<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''1) Login'''<br />
<br />
Go to [http://www.cacert.org/ CAcert's home page], to the right under under My Account click '''Password Login'''<br />
<br />
At the login page enter your '''Email Address''' and '''Pass Phrase''' click '''Login'''.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca1.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''2) Add new Domain'''<br />
<br />
To the right expand the '''Domains''' menu click on '''Add'''<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca2.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''3) Enter a Domain Name'''<br />
<br />
Enter the '''domain name''' (mpg123.no-ip) you wish to verify and click '''Add'''<br />
<br />
'''''Note'':''' Make sure your email server is running before clicking Add.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca3.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''4) Select Email Account'''<br />
<br />
Select one of the standard email accounts.<br />
<br />
Our hMailServer uses the account postmaster hence that was selected.<br />
<br />
Click '''Probe''' (This start the verification process)<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca4.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''5) Verification - by CAcert'''<br />
<br />
After a short time the message shown on the right will be displayed. This confirms the probe was successful.<br />
<br />
'''''Note'':''' The email was sent to your email server and NOT your registration email address.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
&lt;div style=&quot;width:290px&quot;&gt;The domain ‘mpg123.no-ip.org’ has been added to the system, however before any certificates for this can be issued you need to open the link in a browser that has been sent to your email address&lt;/div&gt;<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''6) Verification - by You'''<br />
<br />
After either clicking the link or copying it in to your browser address bar a page is displayed with three options as shown on the right.<br />
<br />
Click '''Yes verify this domain'''.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca5.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''7) Verification Complete'''<br />
<br />
After clicking the link your verified domain name is stored in a database ready for use.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca6.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
'''8) View Verified Domains'''<br />
<br />
In step 2) you can click view, this displays all domains that have been verified.<br />
<br />
Good house keeping, remember to '''delete''' any unused domains.<br />
|valign=&quot;top&quot; style=&quot;background:#f5f5f5&quot;|<br />
[[Image:Uc_cacert_ca7.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== General Notes ==<br />
The domain name verification process requires an email server associated with the domain name. This can be an email server running on your PC as described above.<br />
<br />
The alternative is to point your domain MX records to some other mail server that you use. Free accounts such as DnyDNS and No-IP do not allow you to change MX records, this is not a problem because the SMPT protocol defaults to using the domain name should an MX record not exist, all that means is you must have a mail server running on your PC.<br />
<br />
== Summary ==<br />
The registration process is relatively easy as is domain validation. Obtaining a signed certificate you will be please to know is very quick and painless, this I cover on the [[SSL Part 2: CAcert Signing Process |next page]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Application]]<br />
[[Category: Development]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=FileZilla_Server:_Plugin_Design&diff=4735FileZilla Server: Plugin Design2010-11-24T07:39:28Z<p>Upazixorys: </p>
<hr />
<div>=[http://ipelasuq.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Uc nav FileZilla Server}}<br />
FileZilla Server plugin design for Uniform Server 3.5-Apollo<br />
<br />
Recently I had a requirement for a secure FTP server and decided to use FileZilla. Installed it as a service, worked fine and was relatively easy to set-up.<br />
<br />
I was not to happy with it being installed as an auto-run service hence created two batch files, install-run and stop-uninstall. Originally I thought this server was only capable of running as a service however after looking at the source code discovered compatibly mode for Windows 95. This means it can be run as a standard program making it an ideal candidate for a Uniform Server plugin.<br />
<br />
The following step-by-step guide explains how to convert FileZilla Server along with the problems encountered during this process.<br />
<br />
== Required files ==<br />
Before a plugin can be created it is necessary to extract and isolate all the files. I use the following method install the program, copy all files to a temporary folder and uninstall the program.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Method ===<br />
Download the latest version from [http://filezilla-project.org/download.php?type=server Server Download] (version I used was FileZilla_Server-0_9_27.exe)<br />
<br />
# Create a folder '''zilla_temp'''<br />
# Copy '''FileZilla_Server-0_9_27.exe''' into folder '''zilla_temp'''<br />
# To install double click on '''FileZilla_Server-0_9_27.exe'''<br />
## Click &quot;'''I Agree'''&quot; to license<br />
## Standard configuration is OK click '''Next'''<br />
## Click &quot;'''browse'''&quot; and navigate to folder '''zilla_temp''' click '''next'''<br />
## From the drop down menu select &quot;'''Do not install as service, start server automatically (not recommended)'''&quot; leave admin port set to 14147 click '''Next'''<br />
## From drop down menu select &quot;'''Start manually'''&quot; leave “'''Start Interface after setup completes'''&quot; '''checked''', click '''Install'''.<br />
## When “Installation complete” is displayed click '''Close'''<br />
## When challenged by your Firewall allow to connect to Internet.&lt;br&gt;Leave Server address 127.0.0.1 port 14147 '''unchanged'''.&lt;br&gt;Set a password: '''root'''&lt;br&gt;Leave &quot;Always connect to this server&quot; '''unchecked'''&lt;br&gt;Click '''OK'''&lt;br&gt;When Challenged '''allow connection''' to Internet.&lt;br&gt;'''''Note'':''' Logged on indicates everything is working.<br />
# Quit FileZilla server<br />
# Create a new folder '''zilla_temp_2''' copy the contents of folder '''zilla_temp\FileZilla Server''' to this new folder.<br />
# Navigate to file '''Uninstall.exe''' (\zilla_temp\FileZilla Server) double click to run. This stops/uninstalls service and uninstalls FileZilla Server from your PC.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Extracted files ===<br />
Folder zilla_temp_2 contains the required files:<br />
<br />
*dbghelp.dll<br />
*FileZilla Server Interface.exe<br />
*FileZilla Server Interface.xml<br />
*FileZilla server.exe<br />
*FileZilla server.pdb<br />
*FileZilla Server.xml<br />
*FzGSS.dll<br />
*legal.htm<br />
*libeay32.dll<br />
*license.txt<br />
*readme.htm<br />
*ssleay32.dll<br />
*Uninstall.exe<br />
<br />
Delete '''Uninstall.exe''' it’s not required.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Running the server ==<br />
At this stage you can run the server and check you can log on using the control interface.<br />
<br />
# To start the server double click on '''FileZilla server.exe''' a pop-up is displayed with the option to install service click “'''Yes'''” <br />
# Click “'''NO'''” to auto-start service.<br />
# Click “'''Yes'''” to start server. When challenged by your firewall allow connection to Internet<br />
# To start the interface (admin) double click on '''FileZilla Server Interface.exe''' a pop-up is displayed “Connect to Server” '''click OK'''. This opens the interface window where you set-up the server.&lt;br&gt;All we are interested in is the last line, which states “Logged on” confirming everything is working.&lt;br&gt;Close this window using '''File &gt; Quit'''.<br />
# To stop the server double click on '''FileZilla server.exe''', a pop-up is displayed with the option to “stop server” click “'''Yes'''” <br />
<br />
I think you will agree a toggle menu is a neat way to control the server however for a plugin I prefer to use batch files. <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Command line options ===<br />
The server is controllable using a command line interface, available command line options are:<br />
<br />
* -start –stop<br />
* -install –uninstall<br />
* '''-compat'''<br />
* -reload-config<br />
<br />
Of real importance is '''compat''' this is used for Windows 9x compatibility and allows the server to run as a standard program. It must be the first switch when using a command line.<br />
<br />
The server can be started and stopped using the following command lines:<br />
<br />
*Start server as standard program: '''FileZilla server.exe /compat /start'''<br />
*Stop server standard program: '''FileZilla server.exe /compat /stop'''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Service batch file ==<br />
Before looking at a portable solution its worth testing the server running as a service under batch file control.<br />
<br />
To test the concept create the following batch files and place them in folder '''zilla_temp_2'''.<br />
<br />
=== Install and run - FileZillaFTP_start.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is being installed ... <br />
&quot;FileZilla Server.exe&quot; /install<br />
echo FileZilla FTP Server is starting ... <br />
&quot;FileZilla Server.exe&quot; /start<br />
:pause<br />
&lt;/pre&gt;<br />
<br />
=== Stop and Uninstall - FileZillaFTP_stop.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is being stopped ... <br />
&quot;FileZilla Server.exe&quot; /stop<br />
echo FileZilla FTP Server is being unistalled ... <br />
&quot;FileZilla Server.exe&quot; /uninstall<br />
:pause<br />
&lt;/pre&gt;<br />
<br />
=== FilezillaFTP_admin.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo Starting FileZilla admin ... <br />
&quot;FileZilla Server Interface.exe&quot;<br />
&lt;/pre&gt;<br />
<br />
Run the batch files and test the server; when you are finished remember to run FileZillaFTP_stop.bat otherwise the service remains installed. This is the reason for it not being a portable solution it has the potential to leave dross behind on a machine.<br />
<br />
The standard program batch files resolves this issue.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Standard program batch files ==<br />
The following batch files offer a truly portable solution however there remains one problem to resolve.<br />
<br />
When running a standard program from a batch file the command window remains open until that program (application) is closed. Apache is a classic example, to the rescue Uniform Server’s small utility program '''uniserv.exe''' this allows a program to run in hidden mode.<br />
<br />
I want the plugin to be self-contained to achieve this copy file '''uniserv.exe''' into folder zilla_temp_2 it is used by '''filezila_start.bat''' and '''filezilla_admin_1.bat'''.<br />
<br />
A side effect of running “FileZilla Server Interface.exe” with uniserv.exe is to hide the admin window, hence requires an additional trick. The trick is to run a second batch file that is hidden this hidden batch file runs “FileZilla Server Interface.exe”.<br />
<br />
Place the following new batch files in folder zilla temp_2:<br />
<br />
=== filezila_start.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is starting ... <br />
start uniserv.exe &quot;FileZilla Server.exe /compat /start&quot;<br />
:pause<br />
&lt;/pre&gt;<br />
=== filezila_stop.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is being stopped ... <br />
&quot;FileZilla Server.exe&quot; /compat /stop<br />
:pause<br />
&lt;/pre&gt;<br />
=== filezilla_admin.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo Starting FileZilla admin ... <br />
:start /min filezilla_admin_1.bat<br />
start uniserv.exe filezilla_admin_1.bat<br />
:Pause<br />
&lt;/pre&gt;<br />
=== filezilla_admin_1.bat ===<br />
&lt;pre&gt;<br />
@echo off<br />
echo Starting FileZilla admin ... <br />
&quot;FileZilla Server Interface.exe&quot;<br />
exit<br />
&lt;/pre&gt;<br />
'''''Note'':''' The “'''exit'''” is required otherwise after closing the application the batch file window remains open.<br />
<br />
Although the above batch files work its a proof of concept they need tweaking and along with FileZilla server integrating into Uniform Server’s file structure. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Plugin ==<br />
All that remains for a plugin is to add new batch files to folder “Uniform Server” and place FileZilla program files in an appropriate folder. In folder udrive I created a new folder named “filezilla_server” and copied all the files from zilla_temp_2. Tweaked the old batch files allowing them to be run from a remote location i.e new batch files in folder “Uniform Server”.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Folder - Uniform Server ===<br />
Add the following new batch files to folder Uniform Server:<br />
==== filezila_start.bat ====<br />
&lt;pre&gt;<br />
udrive\filezilla_server\filezilla_start.bat<br />
&lt;/pre&gt;<br />
==== filezila_stop.bat ====<br />
&lt;pre&gt;<br />
udrive\filezilla_server\filezilla_stop.bat<br />
&lt;/pre&gt;<br />
==== filezilla_admin.bat ====<br />
&lt;pre&gt;<br />
udrive\filezilla_server\filezilla_admin.bat<br />
&lt;/pre&gt;<br />
Batch files in folder filezilla_server require tweaking to run locally see below.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Folder - filezilla_server ===<br />
This folder contains the following files:<br />
<br />
* dbghelp.dll<br />
* FileZilla Server Interface.exe<br />
* FileZilla Server Interface.xml<br />
* FileZilla server.exe<br />
* FileZilla server.pdb<br />
* FileZilla Server.xml<br />
* FzGSS.dll<br />
* legal.htm<br />
* libeay32.dll<br />
* license.txt<br />
* readme.htm<br />
* ssleay32.dll<br />
* '''uniserv.exe'''<br />
* '''filezilla_start.bat'''<br />
* '''filezilla_stop.bat'''<br />
* '''filezilla_admin.bat'''<br />
* filezilla_admin_1.bat<br />
<br />
The batch files are tweaked as follows:<br />
==== filezilla_start.bat ====<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is starting ... <br />
pushd %~dp0<br />
start uniserv.exe &quot;FileZilla Server.exe /compat /start&quot;<br />
:pause<br />
popd<br />
&lt;/pre&gt;<br />
==== filezilla_stop.bat ====<br />
&lt;pre&gt;<br />
@echo off<br />
echo FileZilla FTP Server is being stopped ... <br />
pushd %~dp0<br />
&quot;FileZilla Server.exe&quot; /compat /stop<br />
:pause<br />
popd<br />
&lt;/pre&gt;<br />
==== filezilla_admin.bat ====<br />
&lt;pre&gt;<br />
@echo off<br />
echo Starting FileZilla admin ... <br />
pushd %~dp0<br />
:start /min filezilla_admin_1.bat<br />
start uniserv.exe filezilla_admin_1.bat<br />
:Pause<br />
popd<br />
&lt;/pre&gt;<br />
==== filezilla_admin_1.bat ====<br />
&lt;pre&gt;<br />
@echo off<br />
echo Starting FileZilla admin ... <br />
pushd %~dp0<br />
&quot;FileZilla Server Interface.exe&quot;<br />
popd<br />
exit<br />
&lt;/pre&gt;<br />
'''''[[#top | Top]]'''''<br />
== Download ==<br />
Download the following file '''filezilla_server_plugin_design.exe''' from the [[FileZilla Server: Download and support | Download and support page]]. Save it to folder Uniform Server.<br />
<br />
Double click to extract the files no need to change the path. Once extracted if you wish to save space, delete file filezilla_server_plugin_design.exe<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
I have shown design steps in producing the plugin some of the information may be of use. The [[FileZilla Server: Basic Configuration | next page]] covers FileZilla configuration.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Setup]]<br />
[[Category: User Made|Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Home_Web_Server:_Single_Page_Guide&diff=4734Home Web Server: Single Page Guide2010-11-24T07:39:23Z<p>Upazixorys: </p>
<hr />
<div>=[http://ehiqikag.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Home Web Server: <br />
[[Home Web Server: Home | Home]] | <br />
[[Home Web Server: Overview | Overview]] | <br />
[[Home Web Server: Single Page Guide | Single Page Guide]] | <br />
[[Home Web Server: Install | Install]] | <br />
[[Home Web Server: Security | Security]] | <br />
[[Home Web Server: DynDNS Account | DynDNS Account]] | <br />
[[Home Web Server: DynDNS Updater | DynDNS Updater]] | <br />
[[Home Web Server: DynDNS Updater portability | Updater portability]] | <br />
[[Home Web Server: Known Problems | Problems]]<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''Quick Home Web Server'''&lt;br&gt;'''Home Web Server Uniform Server 3.5-Apollo.'''<br />
|}<br />
This page provides a quick tutorial showing how easy it is to put a home web server on-line using Uniform Server 3.5-Apollo.<br />
<br />
== Install Uniform Server 3.5-Apollo ==<br />
{|cellpadding=&quot;4&quot;<br />
|-<br />
|valign=&quot;top&quot;|1&amp;nbsp;||Create a new folder named '''uniserver''' (you can choose whatever name you like)<br />
|-<br />
|valign=&quot;top&quot;|2||Download [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=48193 Uniform Server] (the file you are looking is '''UniServer3_5.exe''') save it to the folder you created in step 1<br />
|-<br />
|valign=&quot;top&quot;|3||Extract files by '''Double-clicking''' on the file '''UniServer3_5.exe''', accept the defaults.<br />
|-<br />
|valign=&quot;top&quot;|4||Once unpacked you will see a new folder named '''Uniform Server''' open this folder.<br />
|-<br />
|valign=&quot;top&quot;|5||Start the servers by double-clicking on '''Server_Start.bat''', when challenged by your firewall allow connection on all ports.<br />
|-<br />
|valign=&quot;top&quot;|6||Your browser will start (if not already running) and a web page will open displaying your web server control panel (apanel).&lt;br&gt; '''''Note'':''' You can run apanel at anytime by typing the following into your browser '''&lt;nowiki&gt;http://localhost/apanel/&lt;/nowiki&gt;'''<br />
|-<br />
|valign=&quot;top&quot;|7|| With apanel displayed scroll down to the '''Configurations''' section of the left menu.<br />
*Click '''MySQL Server Configuration''' at the bottom of this section.<br />
*The default password ('''''root''''') needs changing, type in a new MySQL Password and click change. ('''[[Home Web Server: Security#Set MySQL Password |details]]''')<br />
|-<br />
|valign=&quot;top&quot;|8|| Stop the servers by double-clicking on '''Stop.bat''' in folder Uniform Server.<br />
|}<br />
<br />
'''[[Home Web Server: Install | Check out detailed installation]]'''<br />
<br />
== Put Servers on-line ==<br />
By default Uniform Server is configured to refuse all connections from the outside world. This is controlled by the '''.htaccess''' file in folder C:\uniserver\'''Uniform Server\udrive\www'''.<br />
<br />
'''''Note'':''' '''C:\uniserver''' is the folder and drive you used in step 1.<br />
<br />
To put the servers on-line edit .htaccess as follows:<br />
xxxxxxxxxxxxx<br />
{|cellpadding=&quot;4&quot;<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;9&amp;nbsp;||Open folder '''www'''<br />
|-<br />
|valign=&quot;top&quot;|10||Open the file '''.htaccess''' in a text editor and change the fourth, fifth and sixth lines to this:<br />
:'''&lt;nowiki&gt;#&lt;/nowiki&gt;Order Deny,Allow'''&lt;br&gt;<br />
:'''&lt;nowiki&gt;#&lt;/nowiki&gt;Deny from all'''&lt;br&gt;<br />
:'''&lt;nowiki&gt;#&lt;/nowiki&gt;Allow from 127.0.0.1'''<br />
|-<br />
|valign=&quot;top&quot;|11||'''Save''' the file.<br />
|-<br />
|valign=&quot;top&quot;|12||Start the servers, Double-click '''Server_Start.bat'''<br />
|}<br />
<br />
Detailed information<br />
<br />
=== Test local access ===<br />
Type '''&lt;nowiki&gt;http://localhost/&lt;/nowiki&gt;''' into your browser, Uniform Server image logo displayed (centre of the web page) confirms pages are being served.<br />
<br />
=== Test on-line access ===<br />
If you have a fixed IP address us that in the following test otherwise you need to determine your IP address.<br />
<br />
To do this quickest way is to use the following link [http://www.whatismyip.com/ http://www.whatismyip.com/] type this IP address into your browser for example''' &lt;nowiki&gt;http://12.345.67.899/&lt;/nowiki&gt;'''<br />
<br />
Uniform Server image logo displayed (centre of the web page) confirms pages are being served to the Internet.<br />
<br />
'''''Unable to connect'':'''<br />
<br />
This is not unexpected so don’t be alarmed the servers are working fine confirmed by the local access test. The probable cause, port 80 is not open see next section.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Open and forward port 80 ==<br />
Your web server listens for incoming requests on port 80. If you have either a software firewall (such as Zone Alarm or Windows etc) or a NAT firewall (router), chances are it is set to block these incoming requests on port 80. Hence you will need to configure your firewall to allow incoming requests on port 80.<br />
<br />
I am not going to attempt to show any examples; you would be surprised at the vast number of firewalls available. If you’re having trouble configuring your firewall, check out this site '''[http://www.portforward.com/english/routers/firewalling/routerindex.htm PortForward]''' dedicated to this topic. If your firewall is not listed post a help request<br />
<br />
'''''[[#top | Top]]'''''<br />
== Dynamic IP addresses ==<br />
Majority of service provider’s supply a different IP address every time you connect to the Internet this is referred to as a dynamic IP address.<br />
<br />
To run a web server you require a fixed IP address allowing other Internet users to access your server. In addition you want a domain name that translates to this fixed IP address.<br />
<br />
To resolve this area you require either a Dynamic DNS service provider or obtain a static IP address (costs extra to your standard account) and register a domain name (again extra cost). For testing use a free Dynamic DNS service provider explained below.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Free Dynamic DNS service ==<br />
There are several free dynamic DNS service providers to choose from, I personally like DynDNS. They provide you with a URL and point it to the IP address of your web server. In addition they provide free clients to update the IP address (effectively making it static).<br />
<br />
Create an account at '''[http://www.dyndns.org/ DynDNS]''' log in and set up your account as follows:<br />
<br />
{|cellpadding=&quot;4&quot;<br />
|-<br />
|valign=&quot;top&quot;|1&amp;nbsp;||'''Login''' to DynDNS using your '''name''' and '''password'''.<br />
|-<br />
|valign=&quot;top&quot;|2||Click on '''My services''' (either use left menu or top right link)<br />
|-<br />
|valign=&quot;top&quot;|3||Click on '''Add New Hostname''' (link to the right of Hostnames)<br />
|-<br />
|valign=&quot;top&quot;|4||Enter '''Hostname''': that you wish to use (example: '''fred''')to the right select the second part from the drop down menu (example: '''gotdns.com''')<br />
|-<br />
|valign=&quot;top&quot;|5||Check the '''Wildcard''': box<br />
|-<br />
|valign=&quot;top&quot;|6||'''Service Type:''' select the radio button '''Host with IP address'''<br />
|-<br />
|valign=&quot;top&quot;|7||'''IP Address:''' If the IP address field is not automatically filled in click '''Use auto detected IP address''' link<br />
|-<br />
|valign=&quot;top&quot;|8||Click '''Create Host''' (You may have to repeat this process if that domain is already in use)<br />
|-<br />
|valign=&quot;top&quot;|9||'''''Note'':''' When you now click My services you will see your host listed (example fred.gotdns.com) and your IP address.&lt;br&gt;<br />
If you need to manually change your IP address click on your host link it takes you to the config page.<br />
|}<br />
<br />
Wait 10 to 30 minutes for the records to update. Start your servers and type your new host name into your browser.<br />
In the above example it would be '''www.fred.gotdns.com''' Uniform Server image logo displayed (centre of web page) confirms pages are being served.<br />
<br />
'''[[Home Web Server: DynDNS Account |Check out detailed installation]]'''<br />
<br />
'''''Note'''''<br />
<br />
DynDNS free accounts no longer offer Wildcards a very important feature hence I now recommend DtDNS check out [[DtDNS: Introduction | '''this write-up''']]. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Dynamic DNS updating client ==<br />
Whenever you connect to the Internet your IP address changes. For your DynDNS URL to work you need to login and update the IP address otherwise it will still be pointing to your old IP address, preventing anyone accessing your servers.<br />
<br />
To overcome this manual updating you need to run an update client on your computer. An update client continually monitors your IP address and detects when it changes. On detecting this change automatically logs into DynDNS and updates your IP address. Your URL will always point to the current IP address hence your servers are always accessible.<br />
<br />
You have two options either a fixed or portable installation.<br />
<br />
=== Fixed ===<br />
To obtain a free update client follow these steps:<br />
<br />
# Go to [http://www.dyndns.org/ www.dyndns.org]<br />
# Click the '''Support''' tab<br />
# Click '''Download Now''' to download '''DynDNS Updater (3.1.0.15)''' (save to a folder)<br />
# Follow the install instructions at [http://www.dyndns.com/support/clients/dyndns-updater-guide.html dyndns-updater-guide]<br />
<br />
The above includes a Window installer, this installs all Windows features such as an entry in the all programs folder.<br />
<br />
The installation guide is excellent and easy to follow hence no need to duplicate it here.<br />
<br />
=== Portable ===<br />
I prefer a portable solution and have written a detailed installing guide the steps are as follows:<br />
<br />
{|cellpadding=&quot;2&quot;<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;1&amp;nbsp;||Go to [http://kanasolution.com/download.php?i=36 Kanasolution.com]<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;2||Scroll down the page to '''Without Setup''' and click the download image to download the file '''DynDNS-3.1.0.15.zip'''<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;3||Save this file to folder '''Uniform Server'''. (contains the start and stop batch files)<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;4||Extract the files, right click on the file '''DynDNS-3.1.0.15.zip''' and select extract all, click '''Next''' and '''Next''' again.<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;5||This creates a new folder named DynDNS-3.1.0.15 rename it to '''dyndns_updater'''<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;6||If you wish to save disk space delete the file '''DynDNS-3.1.0.15.zip'''<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;7||Connect to the Internet<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;8||Open folder '''dyndns_updater''' and double click on '''DynDNS.exe'''<br />
|-<br />
|valign=&quot;top&quot;|&amp;nbsp;9||Welcome page is displayed click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|10||Choose your connection type: '''Select Local Area Network''' click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|11||Public IP address: Click '''Detect My IP''', and check that it detects and displays your IP address. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|12||Hostname Group: Enter '''ALL''' (choose anything you like). Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|13||Enter your DynDNS account information '''Username''' and account '''Password'''. Repeat the password in the Confirm box. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|14||Make sure the '''YES''' radio button is selected. This downloads all the hosts that exist in your account. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|15||Hostname Information: '''Check''' the box for each host that you want DynDNS updater to update. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|16|| '''Check''' the box enable automatic update. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|17||Leave both radio buttons '''un-selected'''. Click '''Next'''<br />
|-<br />
|valign=&quot;top&quot;|18||Click '''Finished'''.<br />
|}<br />
<br />
If you need a little more help: <br />
<br />
'''[[Home Web Server: DynDNS Updater |Check out detailed installation]]'''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Running the Updater ===<br />
The updater can be run at any time, it is independent of Uniform Server.<br />
<br />
'''''How to run'''''<br />
<br />
Open the folder '''dyndns_updater''' and double click on '''DynDNS.exe''' this runs the program and places an icon in the system tray (bottom right of screen). A green square with white tick indicates the updater is working.<br />
<br />
Hover over the Icon to displays the current IP address (if it displays 127.0.0.1 connect to the Internet, right click the Icon and force an update by selecting '''Update IP now''')<br />
<br />
'''''Note 1'':''' Your firewall will challenge DynDNS.exe access to the Internet always '''allow access.'''<br />
<br />
'''''Note 2'':''' To view the log file, right click Icon and select '''Show main window''', select the log tab.<br />
<br />
'''''How to stop'''''<br />
<br />
Right click Icon and select '''Exit''', confirm you wish to stop the program by clicking '''OK.'''<br />
<br />
== Testing ==<br />
Connect to the Internet, run the updater and your servers.<br />
<br />
Type your domain name (host name) into your browser for example '''www.fred.gotdns.com''' the Uniform Server default logo is displayed.<br />
<br />
If you copy your site to folder '''www''' (C:\uniserver\'''Uniform Server\udrive\www''') and refresh your browser you will see your index page displayed.<br />
<br />
Your site is now accessible on the Internet enjoy.<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Security]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Home_Web_Server:_Install&diff=4725Home Web Server: Install2010-11-24T07:37:41Z<p>Upazixorys: </p>
<hr />
<div>=[http://ogetehuvo.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
Home Web Server: <br />
[[Home Web Server: Home | Home]] | <br />
[[Home Web Server: Overview | Overview]] | <br />
[[Home Web Server: Single Page Guide | Single Page Guide]] | <br />
[[Home Web Server: Install | Install]] | <br />
[[Home Web Server: Security | Security]] | <br />
[[Home Web Server: DynDNS Account | DynDNS Account]] | <br />
[[Home Web Server: DynDNS Updater | DynDNS Updater]] | <br />
[[Home Web Server: DynDNS Updater portability | Updater portability]] |<br />
[[Home Web Server: Known Problems | Problems]]<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''Just three steps to get Uniserver up and running'''&lt;br&gt;'''Home Web Server Uniform Server 3.5-Apollo.'''<br />
|}<br />
<br />
Uniform Server is a collection of self contained files you extract to '''any folder''' of your choice. In operation it does not use the registry hence you can pop these files onto a USB memory stick and it becomes completely portable. <br />
<br />
It appears to run from a separate drive because it uses the powerful [[New Users Information Snippets#subst | subst command]] this associates a path (where you copied the files to) with a drive letter. These files are run from that location however are accessed via the drive letter assigned. This all adds up to easy installation and operation, follow this quick guide for installation.<br />
<br />
== Download ==<br />
<br />
Download the software package UniServer3_5.exe (if you prefer UniServer3_5.zip) from [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=48193&amp;release_id=521154 SourceForge] for latest release check the Uniform Server [http://www.uniformserver.com/ web site].<br />
<br />
Note: The exe file (7MB ) is about half the size of the ZIP file (13.6MB). Extracted size is around 37.6MB, file sizes may vary <br />
slightly to the figures I have shown.<br />
<br />
== Installation - Step 1 ==<br />
<br />
Installation is a bit of a misnomer; all that is required is to extract the files. First download the above exe file, double click on it; select a folder where you would like the extracted folders and files to be placed. That’s it installation done.<br />
<br />
Here is an example with a little more detail. Note at step two you can use the default folder, once extracted you will see a folder named '''Uniform Server''' this can be '''moved''' with all its sub-folders (to another folder or copy it to your USB memory stick) it can be '''renamed''' to whatever you like. I have extracted my files to drive G into a folder named A1_web_server (I tend to loose folders hence when viewed in explorer A1 pushes it to the top of the folders list).<br />
<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
[[Image:Uc_new_user_server_1.gif]]<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
# '''Double click''' on the file downloaded ('''UniServer3_5.exe'''''Italic text'')<br />
# Select a drive and folder to extract to. For example ('''G:\A1_web_server'''''Italic text'')<br />
# Click on '''Extract''' and the extraction process starts (7Z is a fast utility. It is faster than the Windows utilities yet another reason why I prefer the exe file.)<br />
# When complete the un-zip window closes<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
Navigate to your installation and check out the Uniform Server's folder structure<br />
There are two important folders:<br />
:* '''Uniform Server''' This contains files that control your installation of UniServer. ('''Server_Start.bat''' and '''Stop.bat''')<br />
:* '''www''' This is where you place your Web Site folders and files such as (.htm, .html, .php, .js, .css etc).<br />
For latest news check out release notes in the docs folder.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Running Uniform Server - Step 2 ==<br />
<br />
Use Windows Explorer or MyComputer to locate the folder '''Uniform Server''' (if you renamed it use that new name) here you will find four files '''Server_Start.bat''', '''Disk Start.vbs''', UniController.exe and '''Stop.bat''' these start and stop the servers as follows:<br />
<br />
Note: You only need to use '''Server_Start.bat''' and '''Stop.bat''' to control your servers I have included the other methods for completeness.<br />
----<br />
<br />
=== Alarm Bells ===<br />
Starting the servers for the first time all hell breaks loose regarding fire walls and security programs. When challenged by these programs '''allow all scripts to run''' and '''allow access on all ports'''. Depending on what software or protection you have expect to be challenged several times. However when the servers are re-run everything will be fine.<br />
<br />
The following are a few examples of what to expect:<br />
<br />
&lt;small&gt;''{Forum: 29/9/07 Thanks Tuomash. I have added these images to show other users what to expect}''&lt;/small&gt;<br />
&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
[[Image:Uc_win_1fw.gif]]<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
*OS Windows XP Home<br />
*Windows firewall<br />
*When challenged always click on '''Unblock'''<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
[[Image:Uc_win_2fw.gif]]<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
*OS Windows XP Home<br />
*Windows firewall<br />
*When challenged always click on '''Unblock'''<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
[[Image:Uc_norton_fw.gif]]<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
*OS Windows XP Home<br />
*Norton firewall<br />
*When challenged always select: ['''Always allow connection from this program on all ports (Recommended)''']<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
Your browser may display an error message '''“something like server or page not found”''' this is perfectly normal. It occurs because the browser is active before the servers start running. Once you have trained your firewall or other security measures to allow Apache and MySQL access next time you start these servers the error message will not occur. However do not be surprised if you occasionally get this error message it depends on what processes (programs) are running at the time and what delays occur.<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
=== Starting Apache and MySQL Servers ===<br />
&lt;table width=&quot;60%&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
# To start the Apache and MySQL servers double click on '''Server_Start.bat'''<br />
&lt;/td&gt;<br />
&lt;td width=&quot;164&quot;&gt;<br />
[[Image:uc_server_start_bat.gif]]<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
'''Note 1:''' Depending on your PC’s speed you may see two command windows (black windows) displayed for a short time. These indicate your servers (Apache and MySQL) are starting. If the windows remain the chances are this is the first time you have run your servers please wait until you are challenged by your firewall.<br />
<br />
When challenged make sure you '''allow connection''' on all ports otherwise the servers will be blocked by these security programs.<br />
<br />
While all this is going on your browser if not already running will start and be redirected to UniServer’s control page ('''apanel'''). You may receive a message '''Unable to connect''' this is because your browser has redirected to apanel before your Apache server has had time to start-up, its not a major problem just refresh your browser and all will be fine.<br />
<br />
'''Note 2:''' The drive letter defaults to drive '''W'''<br />
<br />
'''Note 3:''' The server defaults to localhost ('''&lt;nowiki&gt;http://localhost/&lt;/nowiki&gt;''') Type this into your browser address bar and the default index '''test page''' (Blue background with Uniform server log image centrally displayed).<br />
<br />
To display your web site copy it into folder '''www''' and again enter''' &lt;nowiki&gt;http://localhost/&lt;/nowiki&gt;''' or just refresh the page (Note make sure your site has an index page for example index.html, index.htm or index.php). If your index page is named index.php either delete the default index.php page in folder www or allow overwrite when copying your site.<br />
<br />
----<br />
=== Starting Apache, MySQL Server and select drive letter ===<br />
<br />
An alternative method of starting the servers (Apache and MySQL) is to use file Disk Start.vbs. This starts both Apache and MySQL servers. You can optionally change the drive letter.<br />
<br />
&lt;table width=&quot;60%&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
# Double click on '''Disk_Start.vbs'''<br />
# Select a new drive letter or use default (W)<br />
# Start MySQL server YES NO option (This option is redundant both servers will start regardless of the option chosen )<br />
&lt;/td&gt;<br />
&lt;td width=&quot;164&quot;&gt;<br />
[[Image:uc_disk_start_vbs.gif]]<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
Again your browser will start if not already running and be redirected to apanel.<br />
<br />
----<br />
=== Stopping the servers ===<br />
Stopping the servers can be done using the batch file:<br />
<br />
&lt;table width=&quot;60%&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
# Double click on '''Stop.bat''' to stop the servers (alternatively stop the servers via apanel o rUniController). <br />
&lt;/td&gt;<br />
&lt;td width=&quot;164&quot;&gt;<br />
[[Image:uc_stop_bat.gif]]<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
You can use this batch file at any time to stop the servers. You may be surprised at the lack of any tray icons, this is intentional and provides extra flexibility. However the above batch files have been combined into an executable named UniController, this gives you the ability of controling the servers from the task bar.<br />
<br />
----<br />
=== UniController Beta ===<br />
This program allows you to start and stop both servers with the functionality of a standard program (you can minimise and maximise it, places an icon in the toolbar). If you accidentally closed the program just restart it for closing the servers or use stop bat. Be warned that it is a beta version although fully functional it is not pretty looking also I found on my PC is takes a good thirty seconds to start the servers.<br />
<br />
&lt;table width=&quot;60%&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
# Double click on '''UniController.exe'''<br />
# Select a new drive letter or use default (W)<br />
# Click start to start both Apache and MySQL servers<br />
&lt;/td&gt;<br />
&lt;td width=&quot;164&quot;&gt;<br />
[[Image:uc_unicontroller.gif]]<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
'''Note 1:''' You can minimise the program which places an icon in the tool bar. Click the Icon to maximise and use the stop button to stop both the Apache and MySQL servers.<br />
<br />
'''Note 2:''' When run looses focus, (seems to be set to a low order) hence when the browser runs it is placed on top hiding UniController not a major problem click on UniController in the task bar to bring it to the front.<br />
<br />
'''Note 3:''' The Drive Letter [A or C-Z] at start-up does not actually display free drives it is merely an indication of potential candidates to use. Hence make sure the drive letter you chose is not in use.<br />
<br />
----<br />
=== Quick Check ===<br />
Whichever method you choose to start the servers your browser will be redirected to UniServer's Admin Panel page allowing you to configure and display server information, I cover this later. To return to apanel at any time type the following '''&lt;nowiki&gt;http://localhost/apanel/&lt;/nowiki&gt;''' into your browser address bar.<br />
<br />
General note: When you change Apache port for example to 8080 starting the servers automatically redirects to apanel. To run apanel manually you must include the port number for example type the following '''&lt;nowiki&gt;http://localhost:8080/apanel/&lt;/nowiki&gt;''' into your browser address bar.<br />
<br />
Confirm pages are being severed from folder '''www'''. Type '''&lt;nowiki&gt;http://localhost&lt;/nowiki&gt;''' into your browser address bar, a Uniserver logo displayed in the center of the screen confirms correct operation. After a short time redirects back to apanel.<br />
<br />
One final test, copy your own web site (folders and pages) to folder www your index page (index.html or index.htm) will be picked up first and override the default index.php refresh your browser alternatively type '''&lt;nowiki&gt;http://localhost/index.html&lt;/nowiki&gt;''' or '''&lt;nowiki&gt;http://localhost/index.html&lt;/nowiki&gt;''' into your browser address bar and confirm your pages are displayed.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Clean and Test - Step 3 ==<br />
At this stage your servers are working, however it is worth performing a few extra quick checks. With apanel displayed (type &lt;nowiki&gt;http://localhost/apanel/&lt;/nowiki&gt; or &lt;nowiki&gt;http://localhost/a&lt;/nowiki&gt; into your browser address bar) from the left menu un through the following:<br />
Quick tests<br />
<br />
:# Click on '''phpinfo()''' — location — menu on the left<br />
:## You will see a long list of information for PHP Version 5.2.3<br />
:## You can discover what is enabled and running from this information.<br />
<br />
:# Click on '''Apache info''' — again located — menu on the left<br />
:## More information to read.<br />
:## Again every thing you wanted to know about Apache (Version 2.0.59 )<br />
<br />
:# Click on '''phpMyAdmin''' — After a short time you will see a page with the following info at the top:<br />
:## phpMyAdmin 2.10.2<br />
:## Server version: 5.0.41-community-nt<br />
<br />
That completes the tests; your servers are working along with PHP and phpMyAdmin.<br />
=== Clean Server ===<br />
Navigate to folder '''www''' and delete all files and sub-folders with the exception of '''.htaccess''' <br />
<br />
OK this step is not crucial for installation it just gives you a nice clean server to work with.<br />
<br />
Note: apanel provides a button (single click) to perform this task however the following are not removed:<br />
<br />
:* .htaccess<br />
:* favicon.ico<br />
:* images (folder)<br />
:* index.html<br />
<br />
== Summary ==<br />
You now have a superb test environment where you can develop your website using real production servers.<br />
<br />
'''Tip'''<br />
<br />
Make a backup (copy the folder '''Uniform Server''' and all its content to another folder) now feel free to break the original. When beyond repair just delete it and use your backup alternatively use the exe file to install a new copy. It’s this flexibility and ease of use I like.<br />
<br />
'''Security'''<br />
<br />
If you are using your servers for design and development they are locked down to localhost access only and are secure. You can remain connected to the Internet while using them, however I would recommend you check out the section on '''[[Home Web Server: Security | security ]]''' you will need to change the '''[[Home Web Server: Security#Set MySQL Password | MySQL root password ]]''' as a minimum. I apologise for the length of the page do not attempt to read it in one go. Its for reference and covers all server security in one place, each topic is complete hence some duplication.<br />
<br />
All your server settings including security are set using UniServer’s Admin Panel. Putting your servers on line is extremely easy Admin Panel guides you through this process.<br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Security]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=User_talk:Ric&diff=4723User talk:Ric2010-11-24T07:37:24Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://uwujojedeh.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
----<br />
=[http://uwujojedeh.co.cc CLICK HERE]=<br />
----<br />
</div><br />
Yeyyy... Welcome to the wiki Ric ;-) Just added you as Sysop &amp; beau.<br />
<br />
--[[User:Olajideolaolorun|Olajide]] 02:01, 16 May 2008 (UTC)<br />
<br />
Welcome, Ric, hope to be able to have a nice chat with you sometime :)<br />
<br />
MrX, how about you put a signature so he knows??? lol. am umm Ric, do you think we should use the version number in the title? I think its better if we dont because if anything changes, it will most likely be updated on the wiki so i dont think we need to use the version numbers. Oh yeah.. categories! lol. --[[User:Olajideolaolorun|Olajide]] 08:48, 20 May 2008 (UTC)<br />
<br />
Hi Olajide, well I have made a start with transferring pages as you can see from the number of edits have not mastered it yet. Anyway I have popped a new battery in the sat-nav and slowing finding my way around.<br />
<br />
Regarding the version number before the release of 4 if you upgrade 3.5 just up the number to 3.6 will avoid any confusion. There’s a question will there be a 3.6?<br />
<br />
[[User:Ric|Ric]] 20:32, 22 May 2008 (UTC)<br />
<br />
Maybe someday I'll regret answering this on behalf of Olajide, but from what I've heard, I don't think there'll be a 3.6 :) &lt;br /&gt;<br />
By the way, hi Ric :) &lt;br /&gt;<br />
I '''guess''' one of the reasons why Olajide decided on such a big version jump was that 4.0 will come with Apache 2.2 and maybe because he also has some big plans for the Admin Panel :D<br />
<br />
Thanks for that bit of info. In all honesty I have hacked 3.5 to death on more than one occasion (ok out of its design spec) but straight out of the box it works fine so probably no need for 3.6.<br />
<br />
I think 4 needs to have a little more headroom, by this I mean increase in size with more functionality but not bloat ware. An interesting balancing act! When’s Olajide going to join the circus or his he already a member?<br />
<br />
[[User:Ric|Ric]] 21:22, 22 May 2008 (UTC)<br />
<br />
----<br />
<br />
Hey Ric, as MrX said, there will be no 3.6. We are maing a big jump to 4.0 from 3.5, due to most of the reason MrX also mentions ;-) lol. And umm, i am already a member of the circus. lol. Uniform Circus.. :) and yeah, everything takes time, and nothing is ever perfect, so everything is good Ric. I like what you've done so far and welcome to the Wiki. :) --[[User:Olajideolaolorun|Olajide]] 22:58, 22 May 2008 (UTC)<br />
<br />
I guess 4.0 will get a size increase, due to the fact that the Apache 2.2 binaries Olajide will be using is compiled with VC 2008 (aka VC9, released in November last year) and has OpenSSL enabled. So, we'll probably need to add the VC9 runtime(s) (unless their improvement in performance doesn't involve these) and OpenSSL DLLs to avoid some crazy DLL Hell ;)<br />
<br />
MrX, Ric is the one who compiled the Apache 2.2 Migrate. He is the developer in charge of that section of 4.0. I really havent asked him which one he used... --[[User:Olajideolaolorun|Olajide]] 03:40, 23 May 2008 (UTC)<br />
<br />
Ok, Olajide, maybe Ric should get a custom build of Apache with the version reply edited out :D &lt;br /&gt;<br />
Anyway, Ric, have you tested your UniCenter Python plugin to see if it would run Python programs like [[wikipedia:MoinMoin|MoinMoin]]? Olajide: How about a [[wikipedia:FastCGI|mod_fcgid]] plugin for running Perl and Python?&lt;br /&gt;<br />
&lt;RMS&gt;Ric: I also noticed that on your New Users Python Intro page you mentioned that you like the GNU Free Document&lt;u&gt;ation&lt;/u&gt; License, you do know that that's what this wiki uses, right?&lt;/RMS&gt; &lt;br /&gt;<br />
Wow, this talk page has really grown in the past 24 hours :D<br />
<br />
----<br />
Security: Being new to the Wiki I am looking at security and how to protect pages. I have never knowingly published any files containing a virus or malicious content. Hence on the Wiki I will lock down two types of pages any containing an MD5 check sum along with the associated downloadable and any text file pertaining to a batch file.<br />
My tests confirm this is possible OK nothing is 100% secure that’s the real world. It’s all down to a reasonable degree of confidence.<br />
<br />
[[User:Ric|Ric]] 22:51, 23 May 2008 (UTC)<br />
<br />
----<br />
Security: Hi Olajide thanks for the PM. What you propose is ideal from my point of view. I can lock down pages containing MD5 check sums more importantly the exe files (I like 7Z) cannot be tampered with. It’s not just about security but also user confidence when using the Wiki. Hey one added bonus no changes to the Wiki configs.<br />
<br />
When you have it in place I will upload the pages that require exe files.<br />
<br />
[[User:Ric|Ric]] 22:21, 25 May 2008 (UTC)<br />
<br />
----<br />
Hi, Ric. May I know where you're getting the Apache 2.2 binaries (for 4.0) from?<br />
<br />
----<br />
Hi I am not sure what Olajide has planed to use on 4 however the binaries I hacked around were:<br />
<br />
Apache 2.2.8<br />
Downloaded from: http://httpd.apache.org/download.cgi<br />
Version: apache_2.2.8-win32-x86-openssl-0.9.8g.msi<br />
<br />
[[User:Ric|Ric]] 15:52, 26 May 2008 (UTC)<br />
<br />
----<br />
I'm guessing that those were the ones you used for your mini servers, right? &lt;br /&gt;<br />
Well, this is a little strange, just read Olajide's message posted on 03:40, 23 May 2008 a few lines above. When I talked about the Apache 2.2 binaries, Olajide said that you were in charged of that, so I guess it is up to you to decide :) &lt;br /&gt;<br />
Well, the binaries I mentioned above, while talking to Olajide are from http://www.apachelounge.com/download/, there are some module binaries there as well. &lt;br /&gt;<br />
Since Olajide has put you in charged of this, I'm wondering if you have any comments on those binaries. I am also interested to know if you plan to include mod_ssl together with 4.0, or whether you would prefer to distribute that as a separate plugin.<br />
<br />
MrX, stop harassing Ric. Let him do what he has to do.. lol. --[[User:Olajideolaolorun|Olajide]] 08:08, 27 May 2008 (UTC)<br />
<br />
I was just trying to have a meaningful conversation :(<br />
<br />
----<br />
Hi Mr X<br />
I apologise for not getting back. To be honest I am not sure where the mini-server binaries came from, most probably from Hunter that source was my favourite it really is a shame the site has closed. I say not sure because after my disk crash I lost some data. The mini-server info was on a sector or two I could not recover. Always meant to do a full back up but never got around to it.<br />
<br />
I really think now you can’t go wrong if you use binaries from http://httpd.apache.org/download.cgi Apace Org. These will work fine on the mini-servers with no change. I am currently looking at a new write-up and now Apache Org is my first port of call.<br />
<br />
By the way I certainly respect your technical competence and views, after a clean OS install on my new hard drive I had problems with slimFTPd! I remembered you’re post on the forum, what can I say! Spot on, certainly resolved my problem.<br />
<br />
I very rarely can catch you or Olajide in real time on the forum due to the six-hour difference between USA and UK time. <br />
<br />
If I remember correctly you are now a Linux person only interested because I have tried several distributions and never been able to get a connection to my wireless router.<br />
<br />
All the best<br />
<br />
[[User:Ric|Ric]] 21:34, 30 May 2008 (UTC)<br />
<br />
----<br />
Thank you so much for replying, Ric :) &lt;br /&gt;<br />
Could I know more about the now closed &quot;Hunter&quot; site you were talking about? (A URL would be nice) &lt;br /&gt;<br />
About the time difference, I'm 12 hours ahead of Olajide and 7 hours ahead of you. I'm sure we'll be able to find a suitable time to meet up.<br />
<br />
I mentioned the ApacheLounge binaries as on that site, they claim that their binaries are compiled with VC9 and the ones from Apache.org are compiled with VC6. I have no way of testing this without Windows, but I guess that means the binaries are also linked to the latest VC runtime library, which is probably why it has improved performance. Well, I guess that's all I have to say about the binaries. I just wanted to find out what you thought about the improved performance claim, if you don't think that's necessary, I'll respect your decision.<br />
<br />
Finally, Linux. Which distributions did you try? Did you install the distributions on your hard disk or did you use a LiveCD/DVD/USB? I don't have any experience with wireless routers, however, as far as I know, when that's not working, [[wikipedia:NdisWrapper|NDISwrapper]], a driver wrapper, is usually mentioned. There is a [http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,list/ list of supported cards] on their site. I'm not sure if that's a suitable solution to your problem as I don't know why your network card was not detected by the distributions you tried -- because the proper drivers were not compiled into the kernel and then loaded or because your card is incompatible with Linux (not natively supported).<br />
<br />
Another thing, Ric, do you think it'll be better to put your article navigation bar (sorry, I couldn't find a better name for that) in a Template like what Olajide has done for the Development Status, Wiki News, and Did You Know sections in the [[Main Page]]?<br />
<br />
----<br />
Ric, in a few hours it will be a week since my last message. &lt;br /&gt; Please tell me what's the best way to contact you :(<br />
<br />
----<br />
Hi Mr X<br />
<br />
Ya the passage of time, it just disappears hence the delay.<br />
<br />
Hunter provided compiled binaries before Apache started to meet this requirement and needs of Windows users. As for a link the site has gone however this may be [http://mail-archives.apache.org/mod_mbox/httpd-users/200404.mbox/%3C1082830680.22963.70.camel@ptak%3E worth a read ]<br />
<br />
ApacheLounge vs Apache.org binaries to be honest I have never compared speed I am slightly biased towards Apache.org only because they have a superb archive of older versions. <br />
<br />
As for Linux I just can’t afford the time to do it justice, however I have recently tried Knoppix 5.3.1, which allowed me to connect to my router and Internet.<br />
<br />
Template for navigation bar, would be a good idea just that I am so new to this Wiki stuff I have now ideas how to implement it, again lack of time.<br />
<br />
“Ric, in a few hours it will be a week since my last message. <br />
Please tell me what's the best way to contact you :”<br />
<br />
Perhaps a PM on the forum, it probably wont guarantee any faster response time however you can be sure I will read it.<br />
<br />
[[User:Ric|Ric]] 22:26, 6 June 2008 (UTC)<br />
<br />
----<br />
Ric, when you've found enough time, maybe you could try [http://wubi.sourceforge.net/ Wubi]. It allows you to dual boot Linux and Windows by installing [http://ubuntu.com/ Ubuntu Linux] (which is probably one of the most new-user-friendly Linux distributions available) as a file on your existing Windows partition :)<br />
<br />
So, what time are you usually online and checking the forum or wiki?<br />
<br />
<br />
Such a long User Talk page? Wow. Am jealous. lol. --[[User:Olajideolaolorun|Olajide]] 04:10, 7 June 2008 (UTC)<br />
-----<br />
Ric, please take a look at [[Talk:5.3-Nano: Introduction]] for a question about page naming. It might save a lot of work in the long run. I'll also hit the Forum.<br />
BTW, I look forward to helping you out a bit.<br />
<br />
[[User:BobS|BobS]] 19:29, 23 November 2009 (UTC)<br />
<br />
----<br />
<br />
Hello Ric, how put this bar,in MAIN PAGE,my wiki was created in mediawiki cannot enter in my account don't know why. [[User:Knuckles The Echidna|Knuckles The Echidna]] 16:31, 21 August 2010 (UTC)</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Installing_VCalendar_-_part_1&diff=4722Installing VCalendar - part 12010-11-24T07:37:21Z<p>Upazixorys: </p>
<hr />
<div>=[http://ybyfonojot.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
[[Installing VCalendar - part 1 | Installing VCalendar - part 1]] | <br />
[[Installing VCalendar - part 2 | Installing VCalendar - part 2]]<br />
<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''VCalendar'''&lt;br&gt;''' 3.5-Apollo'''<br />
|}<br />
'''How to install VCalendar from UltraApps on 3.5-Apollo.'''<br />
<br />
VCalendar (Virtual Calendar) is a free open source Web calendar for posting and maintaining events and schedules online. It is written in multiple programming languages: PHP, ASP and ASP.NET (C# and VB.NET). There are many online users I chose this one at random http://www4.unm.edu/caps/cal/ it provides some idea of its capability. For personal use, home web server or intranet makes an ideal personal or family diary.<br />
<br />
== Vested Interest ==<br />
I do have a vested interested, not because I am trying sell or convince you to use this excellent product but because of various events that occurred after downloading the program. It all started when I answered a question over on the forum you can view a blow-by-blow account on [http://forum.uniformserver.com/index.php?showtopic=1295&amp;pid=5769&amp;st=0&amp;#entry5769 this page].<br />
<br />
To cut a long story short the events when something like this:<br />
<br />
* Q) does 3.5-Apollo support mb extensions. A) yes<br />
* For fun downloaded the program – Failed on 3.5<br />
* Corrected the undefined field problem – thinking this was his real problem<br />
* His real problem was that day view and day events displayed “There is no data related to this day/event.” However it worked fine on 3.3<br />
* A quick check confirmed this, I down graded 3.5 to use MySQL from 3.3 and it worked fine.<br />
* I sent a support request off to UltraApps who said they would test on the latest MySQL version.<br />
* A wet Sunday (good old British weather) I had nothing better to do hence upgraded UniServer to the latest version of MySQL and VCalendar failed<br />
* I sent this additional information to UltraApps support so as not to waste their valuable time.<br />
* The following day I received a solution, this I duly tested on the three versions of MySQL and the product worked flawlessly.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Logic ===<br />
I am not a software engineer hence take the hardware approach and rip things apart to isolate the problem area. With the 3.3 MySQL installed on 3.5 to a certain extent could point a finger to the 3.5 version of MySQL. I done a little research and that version does have a few bugs hence the upgrade to the latest version. Now VCalendar did not fail as badly. Now I am faced with a problem I know both MySQL and VCalendar work, VCalendar has not changed in these tests so it must be due to subtle changes in MySQL that are responsible the problem. I sent an update of my information to UltraApps and started a long slog to see what differences were implemented between the versions of MySQL. Thankfully this was cut short by UltraApps support response.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Service ===<br />
Well it’s one of those facts of life you pay for the service you get. I have not paid for this application hence expected either a long response time or no response at all. Thought I would show their support case history makes interesting reading:<br />
<br />
*Support case #****<br />
*Date posted 9/30/2007 3:27:40 AM – Initial request support<br />
*Response 9/30/2007 1:40:48 PM – Will get a designer to look at it<br />
*Response 10/1/2007 5:25:13 AM – My Update with all the info<br />
*Response 10/2/2007 2:26:42 PM – Their solution -- (see pre-installation step 7)<br />
*Response 10/2/2007 5:19:28 PM – After testing my thanks<br />
<br />
Now the 30th was a Sunday, the poor chap I assume (George) has a workload and I get a solution within two days.<br />
<br />
Well Robert (support) and George (Software engineer) many thanks, I have no idea who you are but the support was '''first class'''.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Ramble ===<br />
Yep, I do that very well, just thought the above would be of interest. The remainder of this write-up really consolidates what was on the forum. Before I dive in, read the LICENSE.txt file (OK I sometimes do that and it promptly gets ignored) this is not even a one pager, I know what and what I cannot do with this program. I can hack it around for my own needs and even publish it so long as I include the LICENSE.txt file. Well I do just that, to see how small it can be made, further it makes an ideal quick testing program for UniServer.<br />
<br />
Before diving into the quick testing thing I will assume you want to use this program as designed. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Download ==<br />
Download the latest version of VCalendar from UltraApps use [http://www.ultraapps.com/app_downloads.php?app_id=19 this link] will take you to their down load page. On this page you will find a list of Application variants, for UniServer you require the '''''PHP + MySQL''''' variant.<br />
<br />
It currently lists the main program (1.1.5) and a patch (1.1.5.3) you need to download both these files. Save them to a temporary folder for example '''c:\vcalendar_temp'''.<br />
<br />
'''c:\vcalendar_temp'''<br />
* vcalendar_php_1.1.5.zip ---(About 965 KB) Main program<br />
* patch_PHP_1.1.5.3.zip ---( About 16.6 KB) Patch/update files<br />
<br />
Extract each of these files to the current folder (right click on a file to be extracted and select Extract All... click Next and Next again). <br />
<br />
'''''[[#top | Top]]'''''<br />
== Pre-Installation ==<br />
{|<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f9f9f9&quot;|<br />
Download files and and copy to their correct location some modifications are required I have shown the complete steps below:<br />
<br />
<br />
&lt;ol&gt;<br />
&lt;li&gt; To begin, I have assumed you have downloaded Uniform Server 3.5-Apollo from [http://sourceforge.net/project/showfiles.php?group_id=53691&amp;package_id=48193 Sourceforge] and unzipped it to your computer. If you intend going live check out this page first [[Home Web Server: Security |security check list]].&lt;br&gt;'''''Note'':''' You will need the database user name ('''root''') and password that you set for MySQL. I use the Uniform default password ('''root''') in this tutorial.<br />
<br />
&lt;li&gt; Next you need to download and extract VCalendar files as shown in the previous section.<br />
<br />
&lt;li&gt; '''A)''' Copy all the files in folder '''patch_PHP_1.1.5.3''' to folder '''vcalendar''' allow the existing files to be overwritten.<br />
<br />
&lt;li&gt; '''B)''' Copy the folder '''vcalendar''' to folder '''www'''.<br />
<br />
&lt;li&gt; '''C)''' From folder '''www''' copy the file '''.htaccess''' to folder '''vcalendar'''.<br />
<br />
&lt;li&gt; '''D)''' Open the file '''.htaccess''' (which was copied to folder vcalendar) and delete all it's content. Add this line:&lt;br&gt;<br />
<br />
'''DirectoryIndex index.php index.html index.htm'''<br />
<br />
&lt;li&gt; '''E)''' Still in folder vcalendar open the file''' Common.php''' locate line (32):&lt;br&gt;'''''Looks like this'':'''&lt;br&gt;&quot;DateFormat&quot; =&gt; array(&quot;yyyy&quot;, &quot;-&quot;, &quot;mm&quot;, &quot;-&quot;, &quot;dd&quot;, &quot; &quot;, &quot;HH&quot;, &quot;:&quot;, &quot;nn&quot;, &quot;:&quot;, &quot;ss&quot;),&lt;br&gt;'''''Change it to this'':'''&lt;br&gt;'''&quot;DateFormat&quot; =&gt; array(&quot;yyyy&quot;, &quot;-&quot;, &quot;mm&quot;, &quot;-&quot;, &quot;dd&quot;),''' <br />
&lt;/ol&gt;<br />
|<br />
[[Image:Uc_vcalendar_install_1.gif]]<br />
|}<br />
<br />
'''''Note 1'':''' Step 6 VCalendar requires index pages to be looked at in a specific order. The first extension found overrides the other in the list. It is possible to change the main Apache configuration file however ISP's (Internet service providers) will only allow modification via an .htaccess file.<br />
<br />
'''''Note2'':''' Step 7 Resolves subtle differences between MySQL releases without the mod you will receive this message for day events displayed “There is no data related to this day/event.”<br />
<br />
'''''[[#top | Top]]'''''<br />
== Installation ==<br />
Installation really is easy, VCalendar automatically creates the database and populates it with the required tables. The following takes you through the installation steps:<br />
{|cellspacing=&quot;4&quot;<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f9f9f9&quot;|<br />
&lt;ol&gt;<br />
&lt;li&gt; Start Uniform Server using '''Server_Start.bat'''<br />
&lt;li&gt; Type the following into your browser address bar:&lt;br&gt; '''&lt;nowiki&gt;http://localhost/vcalendar/&lt;/nowiki&gt;'''<br />
&lt;li&gt; '''A)''' The page displayed confirms various parameters. All OK means you can continue with installation.<br />
&lt;li&gt; '''B)''' Click on Start Installation.<br />
&lt;/ol&gt;<br />
|<br />
[[Image:Uc_vcalendar_install_2.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f9f9f9&quot;|<br />
&lt;ol start=&quot;5&quot;&gt;<br />
&lt;li&gt; '''C)''' Leave the defaults as '''localhost'''<br />
&lt;li&gt; '''D)''' Database name that will be created change this as required or leave the default as '''vcalendar'''<br />
&lt;li&gt; '''E)''' Check this box, forces VCalendar to create a new database, also opens the additional text fields as shown..<br />
&lt;li&gt; '''F)''' Use '''root''' as the UserName. If you have created a new user in the MySQL server using phpMyAdmin use that.<br />
&lt;li&gt; '''G)''' Use the password you set for the MySQL server (if you have not set this use '''root''') If you created a new user in the MySQL server use the password you set for this user (see step 8)<br />
&lt;li&gt; '''H)''' Use '''root''' as the user name. (see 8)<br />
&lt;li&gt; '''I)''' Use the password you set for the MySQL server (if you have not set this use '''root''') (see 8)<br />
&lt;li&gt; '''J)''', '''k)''' and''' L)''' Is the set-up for Vcalendar's admin account.<br />
&lt;li&gt; '''J)''' You can change this to whatever name you want for VCalendar administrator or leave the default as '''admin'''.<br />
&lt;li&gt; '''K)''' and '''L)''' set the admin password. Do not use the one you set for the MySQL server (see8).<br />
&lt;li&gt; Click on '''Submit'''<br />
&lt;/ol&gt;<br />
|<br />
[[Image:Uc_vcalendar_install_3.gif]]<br />
|-<br />
|valign=&quot;top&quot; style=&quot;background:#f9f9f9&quot;|<br />
&lt;ol start=&quot;16&quot;&gt;<br />
&lt;li&gt;''' M)''' Well that's a good sign, you can now use your VCalendar. Before going online make sure you remove the installation files.&lt;br&gt;Go into folder '''www/vcalendar''' and delete the folder '''install''' that removes all the installation files.<br />
&lt;li&gt; '''N)''' You can click on Start before deleting the above folder to check if everything works.<br />
&lt;/ol&gt;<br />
|<br />
[[Image:Uc_vcalendar_install_4.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
The above explains how to install an online secure version if all you want is to experiment with this program then the [[Installing VCalendar - part 2 |next page]] is for you.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Setup]]<br />
[[Category: User Made|Tutorials]]<br />
[[Category: Self Install]]<br />
[[Category: How To]]<br />
[[Category: Installation]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=FileZilla_Server3:_Basic_Configuration_1&diff=4712FileZilla Server3: Basic Configuration 12010-11-24T06:17:20Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ocavyle.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://ocavyle.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Uc nav FileZilla Server3}}<br />
'''FileZilla Server basic set-up'''<br />
<br />
This page covers basic server configuration it assumes you have extracted and tested portable FileZilla server as explained on the [[FileZilla Server3: Introduction | introduction page]].<br />
<br />
FileZilla server is independent of Uniform Server hence you do not need to start Uniform Server.<br />
<br />
== Recap ==<br />
Before looking at configuration the following summaries which files are used for starting and stopping the server.<br />
<br />
'''A) Portable (Default)'''<br />
{|cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; style=&quot;background:#000000;&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''File'''||'''Function'''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\'''fz_start.bat'''||Start FileZilla Server as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\'''fz_stop.bat'''||Stop FileZilla Server when running as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\'''fz_admin.bat'''||Start FileZilla Server Administration panel<br />
|}<br />
'''B) Static running as a standard program'''<br />
{|cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; style=&quot;background:#000000;&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''File'''||'''Function'''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_start.bat'''||Start FileZilla Server as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_stop.bat'''||Stop FileZilla Server when running as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_admin.bat'''||Start FileZilla Server Administration panel for both standard program or service<br />
|}<br />
'''C) Static running as a service'''<br />
{|cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; style=&quot;background:#000000;&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''File'''||'''Function'''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_service_start.bat'''||Start FileZilla Server as a service<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_service_stop.bat'''||Stop FileZilla Server when running as a service<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|UniServer\filezilla_server\filezilla_ftpd\'''zilla_admin.bat'''||Start FileZilla Server Administration panel for both standard program or service<br />
|}<br />
'''''Note 1'':''' When using option A) you are restricted to uploading/serving files from folder UniServer and any of its sub-folders.<br />
<br />
'''''Note 2'':''' When using options B) or C) there are no restrictions, you can upload/server files from any folder on any hard drive.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Start FileZilla server and Admin ==<br />
I am using option A) however configuration using Admin is identical for B) and C) <br />
<br />
Before using Admin start FileZilla server. <br />
<br />
# Navigate to folder '''UniServer'''<br />
# Start FileZilla server – Double click on '''fz_start.bat'''<br />
# Start FileZilla Admin - double click on '''fz_admin.bat'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Admin ===<br />
{|cellpadding=&quot;6&quot;<br />
|-valign=&quot;top&quot;<br />
|<br />
The Admin interface provides&lt;br /&gt;access to three server sections:<br />
* '''''setting'''''<br />
* '''''users'''''<br />
* '''''groups'''''<br />
<br />
<br />
Default settings allow the server to run straight&lt;br /&gt;<br />
out of the box. These we will tweak latter.<br />
<br />
<br />
There is no default user hence the first thing&lt;br /&gt;<br />
to do is set a user and password covered in&lt;br /&gt;<br />
the next section.<br />
<br />
'''''[[#top | Top]]'''''<br />
|<br />
[[Image:Uc_filezilla_1.gif]]<br />
|<br />
You can select these in one of two ways:<br />
<br />
Either using the top row of icons<br />
* '''A)''' - Settings<br />
* '''B)''' - Users<br />
* '''C''') - Groups<br />
Or from the &quot;Edit&quot; drop down menu<br />
* '''A1)''' - Settings<br />
* '''B1)''' - Users<br />
* '''C1''') - Groups<br />
|}<br />
<br />
== User accounts ==<br />
=== Create a user ===<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|<br />
<br />
For this example we will create a user '''fred''' with password '''fred123''' <br />
<br />
# From Zilla Admin select '''Edit &gt; Users''' B1)&lt;br&gt;Users window displayed<br />
# Select page '''General''' - selected by default D)<br />
# Under users click '''Add''' E)&lt;br&gt;Add user account pop-up displayed<br />
# Type a new user name e.g. '''fred''' F)<br />
# Click '''OK''' - Add user account pop-up disappears G)<br />
# Check '''Enable account''' - Checked by default H)<br />
# Check '''Password box''' J)<br />
# Enter a password e.g. '''fred123''' K)<br />
<br />
If you click OK bottom left the following error message is displayed:<br />
<br />
''You need to share at least one directory and set it as home directory''<br />
<br />
Note 1: '''''Directory and folder are the same thing''''' in the next section we asssign a folder to this user.<br />
<br />
Note 2: You can return to this page at any time, add or delete users, change passwords or even allow name access only.<br />
|<br />
[[Image:Uc_filezilla_2.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Assign a user folder ===<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|<br />
<br />
For this example we will assign the root folder '''www''' to fred.<br />
&lt;ol start=&quot;9&quot;&gt;<br />
&lt;li&gt; Select page '''Shared folders''' - Selected by default L) &lt;/li&gt;<br />
&lt;li&gt; Select '''user''' - Selected by default single user M)&lt;/li&gt;<br />
&lt;li&gt; Under shared folders click '''Add''' N)&lt;/li&gt;<br />
&lt;li&gt; In the pop-up navigate to folder '''C:\UniServer\www''' click to highlight click OK.&lt;br&gt;Note: Your path and drive letter may differ&lt;/li&gt;<br />
&lt;li&gt; The folder selected is displayed O)&lt;br&gt;to the left of this make sure '''“H”''' is displayed&lt;br&gt;if not '''clcik “Set as home dir”''' P)&lt;/li&gt;<br />
&lt;li&gt; '''Select file privileges''' you wish to allow Q)&lt;/li&gt;<br />
&lt;li&gt; '''Select directory privileges''' you wish to allow R)&lt;/li&gt;<br />
&lt;li&gt; Click '''OK''' S)&lt;/li&gt;<br />
&lt;/ol&gt;<br />
<br />
'''''Notes'':'''<br />
<br />
For each new user repeat steps 3-16. You can change user privileges and delete users as required.<br />
<br />
'''Restart''' the server to guarantee changes take effect (generally not required)<br />
|<br />
[[Image:Uc5_filezilla_3.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Quick Test ==<br />
Assuming you are running the server on your '''local machine''' you can quickly test the account.<br />
<br />
Type the following into your browser:<br />
<br />
'''&lt;nowiki&gt;ftp://localhost/&lt;/nowiki&gt;''' a pop-up is displayed enter name ('''fred''') and password ('''fred123''').<br />
<br />
A page is displayed showing files and folders contained in your shared folder ('''www'''). <br />
<br />
=== Local network access ===<br />
Anyone on your local network can access the ftp server by typing '''&lt;nowiki&gt;ftp://your_ip_address&lt;/nowiki&gt;''' into their browser; they will be challenged for a user name and password.<br />
<br />
To find your IP address use a command prompt:<br />
* Open command prompt start &gt; run &gt; type in cmd &gt; clik OK<br />
* In the command window type '''ipconfig /all'''<br />
* Look for your IP address. If you are using a wireless network the address will be similar to this '''192.168.1.6''' <br />
* While in the command window look for '''Host Name''' (my PC name is mpg2) the name of your PC&lt;br&gt;(note sometimes this is not set-up)<br />
<br />
A user can use either HostName or IP address to access your FTP server for example:<br />
<br />
A user on your network would then type '''&lt;nowiki&gt;ftp://192.168.1.6/&lt;/nowiki&gt;'''<br />
Or '''&lt;nowiki&gt;ftp://mpg2/&lt;/nowiki&gt;'''<br />
<br />
Neither of the above is very easy on the eye an alternative is to get each user to add a memorable name to their '''hosts file'''. For example under localhost add a line as shown below:<br />
<br />
127.0.0.1 localhost&lt;br&gt;<br />
'''192.168.1.6 my_ftp_server'''<br />
<br />
They must substitute 192.168.1.6 for your IP address and replace '''my_ftp_server''' with a '''memorable name''', which they would like to use.<br />
<br />
=== Internet access ===<br />
To access your FTP server from the Internet a user would type the following into a browser:<br />
<br />
'''&lt;nowiki&gt;ftp://your_domain_name/&lt;/nowiki&gt;''' alternatively '''&lt;nowiki&gt;ftp://your_external_ip_address&lt;/nowiki&gt;'''<br />
<br />
<br />
'''''On-line help'':'''<br />
<br />
Testing an FTP server for online access can be problematic however there are two useful online services that can help:<br />
<br />
*To find your external IP address use: [http://whatsmyip.org/ Whatsmyip]&lt;br /&gt;Alternatively run &quot;server status&quot; from UniTray.<br />
<br />
*To test FTP access use: [http://www.g6ftpserver.com/en/ftptest Gene6 FTP Server Test], its free for anyone to use.<br />
<br />
<br />
'''''Ports'':'''<br />
<br />
If you have a direct Internet connection there should be no problems with access.&lt;br&gt;However if you are using a router you need to '''forward ports 20 and 21''' every router is different hence pay a visit to [http://portforward.com/ PortForwrd] for detailed instructions.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Problems ==<br />
You may be unlucky and have a service provider that blocks the common FTP ports. In this event try changing the ports. Do not allow your firewall to block Internet access otherwise you will need to manually enable access.<br />
<br />
'''''[[#top | Top]]'''''<br />
== FTP Clients ==<br />
Using a browser allows for quick testing however an FTP client offers more flexibility my personal favourite is FireFTP running on Firefox. It’s a personal taste hence choose one that suits your needs.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
The above shows how easy FileZilla server is to set-up and test. The next page covers mapping [[FileZilla Server3: Basic Configuration 2 | alias folders]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Setup]]<br />
[[Category: How To]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=FileZilla_Server3:_Implicit_SSL_part_1&diff=4706FileZilla Server3: Implicit SSL part 12010-11-24T06:16:38Z<p>Upazixorys: </p>
<hr />
<div>=[http://yzobiwysac.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
{{Uc nav FileZilla Server3}}<br />
'''Implicit SSL'''<br />
<br />
The previous pages descried how to install the FileZilla server on uniform server. Passwords and data are sent unencrypted over the Internet. Depending on your application and use this is adequate and suitable for most purposes.<br />
<br />
FileZila FTPd overs a much more secure alternative using SSL to encrypt both passwords and data. There are a number of steps required in setting up a secure FTP server hence is relatively difficult. I have split this over two pages making it clearer and hopefully easier to understand.<br />
<br />
The procedure is incremental first create a server certificate ensure it runs on a local network and finally configure for Internet access.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Server certificate ==<br />
FileZilla has a built in certificate generator making this process very easy.<br />
<br />
{|<br />
|-<br />
|valign=&quot;top&quot; width=&quot;100%&quot;|<br />
==== Enable SSL support ====<br />
* Navigate to folder '''UniServer'''<br />
# Start FileZilla server by double clicking on '''fz_start.bat'''<br />
# Start FileZilla administration interface, double click on '''fz_admin.bat'''<br />
# Select '''Edit &gt; Settings''' <br />
# From the left menu '''click''' on '''SSL/TLS settings''' - A)<br />
# Check '''Enable SSL/TSL support''' - B)<br />
# Default '''Allow explicit SSL/TLS on normal connections''' - C)<br />
# Checks '''Disallow Plain Unencrypted FTP''' - D)<br />
# Default Listen for SSL/TLS –only connections on port '''990''' - E)<br />
# Click '''Generate new certificate''' - F)<br />
'''''Note'':'''<br />
* No need to fill in Private key or Certificate files - Automatically added after next section.<br />
* No need to fill in Key password box - not required.<br />
<br />
'''''[[#top | Top]]'''''<br />
|<br />
[[Image:Uc5_filezilla_4.gif]]<br />
|-<br />
|valign=&quot;top&quot;|<br />
<br />
==== Fill in certificate details ====<br />
Clicking Generate new certificate opens the certificate form fill in as follows: <br />
&lt;ol start=&quot;10&quot;&gt;<br />
&lt;li&gt; '''Seclect Key size''' 4096bit - G) - may need to reduce this to 1024&lt;/li&gt;<br />
&lt;li&gt; Insert 2-Digit '''country code''' - H)&lt;/li&gt;<br />
&lt;li&gt; Fill in some '''real or dummy information''' a) to f)&lt;/li&gt;<br />
&lt;li&gt; '''Fill in Common name''' Use '''localhost''' or your real domain name - I)&lt;/li&gt;<br />
&lt;li&gt; Click browse button - J)&lt;br&gt;<br />
Navigate to folder '''C:\UniServer\filezilla_server'''&lt;br&gt;This is where the certificate will be saved.&lt;br&gt;&lt;br&gt;<br />
'''''Note 1'':''' Your virtual drive letter may be different hence use that.&lt;br&gt;'''''Note 2'':''' If you are not using portable mode choose any folder you like.&lt;br&gt;However its a good idea to use folder&lt;br&gt;*\filezilla_server\filezilla_server_portable&lt;br&gt;&lt;br&gt; <br />
&lt;/li&gt;<br />
&lt;li&gt; Click '''Generate certificate''' this will take a while. - K) &lt;/li&gt;<br />
&lt;li&gt; When complete click '''OK''' - L)<br />
&lt;/ol&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
|<br />
[[Image:Uc5_filezilla_5.gif]]<br />
|-<br />
|valign=&quot;top&quot;|<br />
<br />
==== Enable user to use SSL ====<br />
&lt;ol start=&quot;17&quot;&gt;<br />
&lt;li&gt; From FileZilla admin select '''Edit &gt; Users'''&lt;/li&gt;<br />
&lt;li&gt; Select page '''General''' - left menu&lt;/li&gt;<br />
&lt;li&gt; '''Select a user account''' - M)&lt;/li&gt;<br />
&lt;li&gt; '''Check Bypass''' - N)&lt;/li&gt;<br />
&lt;li&gt; '''Check Force SSL''' for user login - O)&lt;/li&gt;<br />
&lt;li&gt; Click '''OK''' - P)&lt;/li&gt;<br />
&lt;li&gt; '''Restart server'''&lt;/li&gt;<br />
&lt;/ol&gt;<br />
<br />
That completes the FileZille set-up.<br />
<br />
'''''Note'':'''<br />
<br />
Although we are using a single user account the above can be applied to other users.<br />
<br />
You can have a mix of users some using encryption while other do not the choice is yours. <br />
<br />
'''''[[#top | Top]]'''''<br />
|<br />
[[Image:Uc_filezilla_6.gif]]<br />
|}<br />
<br />
== Client - FireFTP ==<br />
{|<br />
|-<br />
|valign=&quot;top&quot; width=&quot;100%&quot;|<br />
==== FireFox and FireFTP ====<br />
I am assuming your are using FireFox and FireFTP these two are a great combination.<br />
<br />
You can use your preferred client the set-up will be similar. Check your clients manual for instructions. <br />
<br />
<br />
'''''Start FireFTP'':'''<br />
* Start FireFTP plugin '''Tools &gt; FireFTP'''<br />
<br />
===== Main Tab =====<br />
# Select '''Main''' tab<br />
# '''Enter a host''' either use IP address 127.0.0.1 or host name localhost - R)<br />
# '''Enter an Account name''' Can be anything you like. - Q)<br />
# '''Enter login name''' e.g '''''fred''''' (ftp user name) - S)<br />
# '''Enter password''' for fred '''''fred123''''' (ftp user account password) - T) <br />
<br />
'''''[[#top | Top]]'''''<br />
|<br />
[[Image:Uc_filezilla_7.gif]]<br />
|-<br />
|valign=&quot;top&quot; width=&quot;100%&quot;|<br />
===== Connection Tab =====<br />
&lt;ol start=&quot;6&quot;&gt;<br />
&lt;li&gt; '''Click on Connection''' tab - U)&lt;/li&gt;<br />
&lt;li&gt; From the drop down menu '''select Implicit SSL''' (Good) - V)&lt;/li&gt;<br />
&lt;li&gt; Check the port number '''990''' is set - W)&lt;/li&gt;<br />
&lt;li&gt; Finally click '''OK''' - X)&lt;/li&gt; <br />
&lt;/ol&gt;<br />
'''''Note'':''' You may need to check the IPv6 box for 4096bi!<br />
<br />
===== Local test =====<br />
From FireFTP click the '''Connect button''' enter name and password.<br />
<br />
Your browser will have a whinge, create a [[5.0-Nano: Enable SSL#Browser issues and Problems| certificate exception]].<br />
<br />
FTP folder will display.<br />
<br />
===== Local network test =====<br />
On another PC connected to your network repeat the above steps 1-9.<br />
<br />
'''Note:''' At step 1 enter your PC’s IP address. (See Basic Configuration 1 page how to [[FileZilla Server3: Basic Configuration 1#Local network access | obtain IP address]])<br />
<br />
That confirms you can access the FTP server across your network.<br />
|<br />
[[Image:Uc_filezilla_8.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Client - FieZilla ==<br />
For completeness I have included this section it shows how to install portable FileZilla client and how to use it for testing the above.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Install ===<br />
# Create a new folder C:\'''FileZilla_client''' (can be any name)<br />
# Download the latest client '''FileZillaPortable_3.3.0.1.paf.exe''' from [http://portableapps.com/ PortableAppas]<br />
# Save to the above folder<br />
# Double click on '''FileZillaPortable_3.3.0.1.paf.exe''' to extract<br />
# Select language '''English''' click '''OK'''<br />
# Click '''Next'''<br />
# Choose Components '''defaults are OK''' click '''Next'''<br />
# Click '''Browse''' navigate to folder C:\'''FileZilla_client'''<br />
# Click '''Install'''<br />
# Click '''Finish'''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Run Client ===<br />
# Navigate to folder C:\FileZilla_client\'''FileZillaPortable'''<br />
# To run double click on file '''FileZillaPortable.exe'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Local test ===<br />
Using quick connect makes testing extremely easy fill in the top row as follows:<br />
<br />
{|cellspacing=&quot;10&quot;<br />
|-valign=&quot;top&quot;<br />
|<br />
* A) Enter Host '''ftps:/localhost'''<br />
* B) Enter Username '''fred'''<br />
* C) Enter Password '''fred123'''<br />
* D) Enter port '''990'''<br />
* F) Click Quickconnect<br />
* A pop-up is displayed '''Unknown certificate''' click OK&lt;br /&gt; Creates an exception.<br />
<br />
You can now view and navigate folders assigned to user '''fred''' <br />
<br />
|<br />
[[Image:UC5_Zilla_client.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
The above provides a secure link to your FTP server. If you are running a wireless network, data can be intercepted by sniffing the radio signals.<br />
<br />
Should your basic wireless security be compromised the FTP encryption will provide another hurdle making it more difficult for that data to be accessed.<br />
<br />
You do need the above security when FTPing data across the Internet. Before proceeding to the [[FileZilla Server3: Implicit SSL part 2 | final part]] make sure you can securely FTP locally.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Setup]]<br />
[[Category: How To]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=MongoDB:_Plugin&diff=4701MongoDB: Plugin2010-11-24T06:16:24Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://imygijesusy.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
----<br />
=[http://imygijesusy.co.cc CLICK HERE]=<br />
----<br />
</div><br />
{{Nav MongoDB}}<br />
'''''MongoDB'''''<br />
== Introduction ==<br />
The Uniform Server MongoDB plugin installs MongoDB server, the phpMoAdmin browser administration interface and the PHP driver on Uniform Server 6-Carbo. <br />
<br />
A Windows interface is provided, allowing you to start and stop both Apache and MongoDB servers. From this interface you can start either the mongo-client or phpMoAdmin. These programs allow you to administer mongo-databases. In addition, a single button click opens a command window giving you access to Mongo’s suite of command-line tools.<br />
<br />
It’s the Windows interface (implemented using WinBinder) that makes this plugin specific to Uniform Server 6-Carbo. The core component, however, will run alongside any version of Uniform Server or other server. See [[#MongoDB twist || '''MongoDB twist''']] for details. <br />
<br />
== Download and Install ==<br />
=== Options 1 ===<br />
# Download file '''''mongo_plugin_v1_0.exe''''' from Sourceforge. For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]<br />
# Save it to folder '''UniServer'''.<br />
# To extract files, double click on file mongo_plugin_v1_0.exe, no need to change the path.<br />
# A new file '''Start_MongoDB.exe''' is added to folder UniServer.<br />
<br />
=== Options 2 ===<br />
# Download file '''''mongo_plugin_v1_0.zip''''' from Sourceforge. For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]<br />
# Save to any folder e.g temp<br />
# Extract files, navigate to folder temp\mongo_plugin_v1_0<br />
# Copy contents of this folder to folder UniServer<br />
<br />
== Run ==<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Start Windows interface'''''<br />
<br />
Double click on file '''Start_MongoDB.exe''' located in folder UniServer.<br />
<br />
* I hate nag pop-ups, but this one is very important.<br />
* '''Always''' close MongoDB before turning your PC off.<br />
* It needs to perform a clean up to maintain data integrity.<br />
<br />
The nag pop-up can be infuriating, but you can click '''''no''''' to not display it again at next start up.<br />
<br />
'''''Note'':''' If you want to restore the nag pop-up, delete the following file:<br />
<br />
UniServer\usr\local\mongo\us_info\'''no_nag.txt'''<br />
|<br />
[[Image:MongoDB_1_start.gif]]<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Start Servers'''''<br />
<br />
Start server click '''Start MongoDB and Apache''' button.<br />
<br />
'''''Note'':''' With the servers running, greyed out buttons are enabled.<br />
<br />
'''''Stop Server'''''<br />
<br />
Button toggles displaying '''Stop MongoDB and Apache'''<br />
<br />
'''''Open cmd Window'''''<br />
<br />
Opens a command window and changes to folder:UniServer\usr\local\mongo\bin<br />
<br />
Provides access to Mongo’s suite of command-line tools. <br />
|<br />
[[Image:MongoDB_1_initial.gif]]<br />
|-valign=&quot;top&quot;<br />
|<br />
'''Button ''Start Mongo Client'''''<br />
<br />
Opens a command window and runs mongo-client. Button is enabled when servers are running; otherwise it's disabled.<br />
<br />
'''Button ''Run phpMoAdmin'''''<br />
<br />
Opens phpMoAdmin in default browser. Button is enabled when servers are running; otherwise it's disabled.<br />
<br />
'''Button ''Help and Information'''''<br />
<br />
Opens main read me file in Notepad. <br />
<br />
|<br />
[[Image:MongoDB_1_initial_b.gif]]<br />
|}<br />
<br />
'''''Note 1'':''' When challenged by your firewall, always grant Internet access<br />
<br />
'''''Note 2'':''' Plugin is self-contained. No need to run UniTray. <br />
<br />
'''''Note 3'':''' This plugin runs as a standard program and not as a service. <br />
It is for development '''only'''! Do not use for a production server!<br />
<br />
=== Test ===<br />
This plugin includes a test script allowing you to explore. <br />
<br />
I assume you have started Windows interface and servers:<br />
* Start MongoDB - Double click on Start_MongoDB.exe<br />
* Run Servers - Click &quot;Start MongoDB and Apache&quot; button<br />
<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Run test script'''''<br />
<br />
Type into a browser http://localhost/mongo_test_1.php<br />
<br />
Nothing spectacular happens; it creates a database and displays entries as shown on the right.<br />
|<br />
[[Image:MongoDB_1_test_script.gif]]<br />
|-valign=&quot;top&quot;<br />
|<br />
'''''Run phpMoAdmin'''''<br />
<br />
Click &quot;Run phpMoAdmin&quot; button<br />
<br />
Test script creates a database with two entries; this allows you to explore phpMoAdmin features. <br />
<br />
Generally have a play. Run mongo-client and explore its capabilities.<br />
<br />
Refresh phpMoAdmin to view changes.<br />
|<br />
[[Image:MongoDB_1_phpmoadmin.gif]]<br />
|}<br />
=== Clean up ===<br />
When you have finished playing you probably will want to clean up and start afresh.<br />
<br />
# Close MongoDB – Click &quot;Stop MongoDB and Apache&quot; button<br />
# Navigate to folder: UniServer\usr\local\mongo\data\'''mongodb'''<br />
# Delete its contents. Removing all databases created, which effectively gives you a clean install.<br />
<br />
==== New User ====<br />
If you are a new user to Uniform Server, welcome. Your website files are placed in folder UniServer\www.<br />
<br />
To clean this folder prior to adding your material, you can delete everything except file '''.htaccess'''.<br />
<br />
Plugins may add to this folder for testing. MongoDB plugin adds a single file '''mongo_test_1.php''' which you may delete after testing.<br />
<br />
<br />
== MongoDB twist ==<br />
MongoDB is a server in its own right and can be run independently of Uniform Server. <br />
<br />
If you have ever looked at other Uniform Server plugins you will find what appears to be redundant code. This plugin is no exception. It contains the minimal amount of code to run MongoDB server independently. <br />
<br />
=== Extract MongoDB core ===<br />
Buried within the plugin is a MongoDB core; once extracted it can be run independently.<br />
<br />
Extract as follows:<br />
<br />
* Create two new folders for example mongo_temp and mongo_temp2<br />
* Download plugin either '''mongo_plugin_v1_0.exe''' or mongo_plugin_v1_0.zip <br />
* Save to mongo_temp and extract by double clicking on '''mongo_plugin_v1_0.exe''' <br />
* Navigate to folder mongo_temp\usr\local\'''mongo'''<br />
* Copy this folder and all its content to folder '''mongo_temp2'''<br />
* You can delete folder mongo_temp its no longer required.<br />
* Delete folder mongo_temp2\mongo\'''us_info''' not required<br />
<br />
'''''Note'':''' <br />
<br />
You can copy folder mongo_temp2\mongo and all its contents to any location and run from there.<br />
<br />
<br />
=== Alternative control ===<br />
That redundant code I mentioned above is contained in folder '''alt_control_2'''<br />
<br />
It contains batch files to start and stop MongoDB server.<br />
<br />
They use '''uniserv.exe''' to run MongoDB hidden in the background. <br />
<br />
For convenience, two batch files are provided. One opens a command prompt allowing you to access Mongo’s command line tools, and the other directly runs the Mongo client tool.<br />
<br />
'''''Files'':'''<br />
&lt;pre&gt;<br />
Start_mongo.bat - Run MongoDB server hidden<br />
Stop_mongo.bat - Cleanly stop MongoDB server<br />
monogo_client.bat - Directly runs mongo-client<br />
run_cmd.bat - Opens a command window changes to bin folder allowing<br />
you to run MongoDB's command line tools<br />
uniserv.exe - Uniform Server utility. Runs a program in background.<br />
&lt;/pre&gt;<br />
<br />
'''''Note'':'''<br />
<br />
You can delete folder '''alt_control'''. It contains batch/script pairs that are not required. <br />
<br />
<br />
== Summary ==<br />
Installing and running the MongoDB plugin is quick and easy.<br />
<br />
Hey! If you don’t like the control interface, change it; [[MongoDB Tutorial 2: Introduction | MongoDB Tutorial 2]] provides details.<br />
<br />
----<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 6-Carbo]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=FileZilla_Server3:_Introduction&diff=4699FileZilla Server3: Introduction2010-11-24T06:15:49Z<p>Upazixorys: </p>
<hr />
<div>=[http://ecacoraqosy.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Uc nav FileZilla Server3}}<br />
<br />
'''FileZilla Server FTPd (0.9.33)'''<br />
<br />
FileZilla FTPd is a server in its own right. Because of this it has been packaged to provide both static and portable operation.<br />
<br />
You can use either one or the other operation mode as described below.<br />
== Static Operation ==<br />
FileZilla FTPd is self-contained and totally independent of Uniform Server. Hence it can be moved to a permanent location on your PC and run from there. If you are running Uniform Server as a fixed installation, there is no need to move FileZilla FTPd.<br />
<br />
FileZilla server can be run either as a standard program or as a service. Static operation allows file transfers from any folder on any drive.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Download and install ===<br />
Depending on the version of Uniform Server, there are two download options as follows:<br />
<br />
'''''Option 1'':'''<br />
<br />
Uniform Server versions 5.0-Nano to 5.4-Nano download <br />
<br />
Download file [http://sourceforge.net/projects/miniserver/files/Plugins/Uniform%20Server%205-Nano%20Plugins/Portable%20FileZilla%20Server/USV5_FileZillaFTPd_1.0.exe/download '''USV5_FileZillaFTPd_1.0.exe'''] from SourceForge<br />
<br />
'''''Option 2'':'''<br />
<br />
Uniform Server version 5.5-Nano <br />
<br />
Download file [http://sourceforge.net/projects/miniserver/files/Plugins/UniServer%2055-Nano%20Plugins/FileZilla%20Server/V55_FileZillaFTPd_1.0.exe/download '''V55_FileZillaFTPd_1.0.exe'''] from SourceForge<br />
<br />
UniTray’s configuration was changed and Russian language added.<br />
<br />
<br />
'''''Note 1'':''' Installation procedure is identical.<br />
<br />
Decide how you want to install FileZilla server, either independent of Uniform Server (in a folder located outside of the UniServer folder), or within the UniServer folder.<br />
<br />
'''''Note 2'':''' Whichever method you choose, the operation of FileZilla server is identical.<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Independent of Uniform Server =====<br />
# Create a new temp folder, for example “temp1”<br />
# Save USV5_FileZillaFTPd_1.0.exe to this folder<br />
# Double click on USV5_FileZillaFTPd_1.0.exe to start the self-extracting process<br />
# Allow extracting to current folder.<br />
# Navigate to folder '''filezilla_ftpd''' and move this to the desired location on your PC<br />
# To save space, delete folder “temp1”<br />
<br />
'''''[[#top | Top]]'''''<br />
==== Or within UniServer folder ====<br />
# Save USV5_FileZillaFTPd_1.0.exe to folder UniServer<br />
# Double click on USV5_FileZillaFTPd_1.0.exe to start the self-extracting process<br />
# Allow extracting to current folder.<br />
# In folder UniServer, delete the following files: '''USV5_FileZillaFTPd_1.0.exe''', '''fz_start.bat''', '''fz_stop.bat''' and '''fz_admin.bat'''.<br />
<br />
'''''Note'':''' Above batch files are for portable use, and not required for a static installation of FileZilla.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Extracted files - Overview ===<br />
Folder UniServer\filezilla_server\'''filezilla_ftpd''' contains FileZilla’s core components including the following batch files:<br />
<br />
{|cellspacing=&quot;4&quot; cellpadding=&quot;2&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''File'''||'''Function'''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''zilla_start.bat'''||Start FileZilla Server as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''zilla_stop.bat'''||Stop FileZilla Server when running as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''zilla_service_start.bat'''||Start FileZilla Server as a service<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''zilla_service_stop.bat'''||Stop FileZilla Server when running as a service<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''zilla_admin.bat'''||Start FileZilla Server Administration panel for both standard program or service<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
==== Running as a Standard Program ====<br />
{|<br />
|-<br />
|[[Image:Zilla_admin.gif]]<br />
|valign=&quot;top&quot; |<br />
# Navigate to folder UniServer\filezilla_server\'''filezilla_ftpd'''<br />
# Double click on '''zilla_start.bat''' - Starts server as a standard program&lt;br /&gt;''Note'': When run for first time creates file FileZilla Server.xml&lt;br /&gt;<br />
# Double click on '''zilla_admin.bat''' <br />
# A pop-up (Connect to server) is displayed, click '''OK''' - Starts admin window.&lt;br /&gt;Note 1: When run for first time creates file FileZilla Server Interface.xml&lt;br /&gt;''Note 2'': A tray icon is created. <br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
# '''Logged on''' confirms connection to server and correct operation.<br />
# If the connection fails an error message is displayed.&lt;br /&gt; Several attempts are made before eventually giving up.<br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
# Double click on '''zilla_stop.bat''' - Stops server<br />
# Also breaks connection.<br />
# '''Error message''' confirms connection broken and correct operation.<br />
# Close admin panel '''File &gt; Quit''' or click top right '''cross'''<br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
==== Running as a Service ====<br />
{|<br />
|-<br />
|[[Image:Zilla_admin.gif]]<br />
|valign=&quot;top&quot; |<br />
# Navigate to folder UniServer\filezilla_server\'''filezilla_ftpd'''<br />
# Double click on '''zilla_service_start.bat''' - Installs and starts server as a service&lt;br /&gt;''Note'': When run for first time creates file FileZilla Server.xml&lt;br /&gt;<br />
# Double click on '''zilla_admin.bat''' <br />
# A pop-up (Connect to server) is displayed, click '''OK''' - Starts admin window.&lt;br /&gt;Note 1: When run for first time creates file FileZilla Server Interface.xml&lt;br /&gt;''Note 2'': A tray icon is created. <br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
# '''Logged on''' confirms connection to server and correct operation.<br />
# If the connection fails an error message is displayed.&lt;br /&gt; Several attempts are made before eventually giving up.<br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
# Double click on '''zilla_service_stop.bat''' - Stops and uninstalls server service<br />
# Also breaks connection.<br />
# '''Error message''' confirms connection broken and correct operation.<br />
# Close admin panel '''File &gt; Quit''' or click top right '''cross'''<br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Summary 1 ===<br />
That completes server testing. You can now move onto [[FileZilla Server3: Basic Configuration 1 | configuration]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Portable Operation ==<br />
The FileZilla FTPd plugin defaults to portable operation. This allows you to move both Uniform and FileZila servers to any location, such as running from a USB memory stick.<br />
<br />
File transfers are '''restricted''' to folders within the main UniServer folder, hence this mode of operation is primarily intended only for test purposes. Locations outside this folder are not possible since portability requires all absolute paths to be rewritten. <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Download and install ===<br />
Download file '''USV5_FileZillaFTPd_1.0.exe''' from SourceForge<br />
<br />
# Save USV5_FileZillaFTPd_1.0.exe to folder '''UniServer'''<br />
# Double click on USV5_FileZillaFTPd_1.0.exe to start self-extracting process<br />
# Allow extracting to current folder.<br />
# In folder UniServer, delete the following file: '''USV5_FileZillaFTPd_1.0.exe'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Extracted files - Overview ===<br />
Folder UniServer\filezilla_server\'''filezilla_ftpd''' contains FileZilla’s core components.<br />
<br />
Folder UniServer contains the following batch files:<br />
<br />
'''''Note'':''' Description column provides a quick overview of their function.<br />
<br />
{|cellspacing=&quot;4&quot; cellpadding=&quot;4&quot;<br />
|-style=&quot;background:#e8e8e8;&quot;<br />
|'''File'''||'''Function'''<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''fz_start.bat'''||Start FileZilla Server as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''fz_stop.bat'''||Stop FileZilla Server when running as a standard program<br />
|-valign=&quot;top&quot; style=&quot;background:#f5f5f5;&quot;<br />
|'''fz_admin.bat'''||Start FileZilla Server Administration panel<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
==== Running as a Standard Program Portable ====<br />
{|<br />
|-<br />
|[[Image:Zilla_admin.gif]]<br />
|valign=&quot;top&quot; |<br />
# Navigate to folder '''UniServer'''<br />
# Double click on '''fz_start.bat''' - Starts server as a standard program&lt;br /&gt;''Note 1'': When run for first time creates file FileZilla Server.xml&lt;br /&gt;''Note 2'': Subsequent starts will rewrite paths in file FileZilla Server.xml if servers are moved to a new location.<br />
# Double click on '''fz_admin.bat''' <br />
# A pop-up (Connect to server) is displayed, click '''OK''' - Starts admin window.&lt;br /&gt;Note 1: When run for first time creates file FileZilla Server Interface.xml&lt;br /&gt;''Note 2'': A tray icon is created <br />
&lt;br /&gt;&lt;br /&gt;<br />
# '''Logged on''' confirms connection to server and correct operation.<br />
# If the connection fails an error message is displayed.&lt;br /&gt; Several attempts are made before eventually giving up.<br />
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
# Double click on '''fz_stop.bat''' - Stops server<br />
# Also breaks connection.<br />
# '''Error message''' confirms connection broken and correct operation.<br />
# Close admin panel '''File &gt; Quite''' or click top right '''cross'''<br />
<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== Summary 2 ===<br />
That completes server testing. You can now move onto [[FileZilla Server3: Basic Configuration 1 | configuration]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
I split the above into two separate sections making it easier to understand.<br />
<br />
Next page covers [[FileZilla Server3: Basic Configuration 1 | basic configuration]] which is common to whatever method you use to start FileZilla server. <br />
<br />
If you want to tailor Uniform Server and FileZilla to meet your own requirements, there are options to do this. These are covered later. <br />
<br />
The [[FileZilla Server3: Install Options| Install Options page]] provides details for the various options and how to make modifications if you wish. <br />
<br />
The core element portable FileZilla FTPd is covered on the next page. As explained above, to offer maximum flexibility the design allows it to be used independently of Uniform Server. FileZilla is periodically updated hence the page includes an update guide. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Setup]]<br />
[[Category: How To]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Installing_Moodle_on_4.0-Mona&diff=4698Installing Moodle on 4.0-Mona2010-11-24T06:15:43Z<p>Upazixorys: </p>
<hr />
<div>----<br />
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"><br />
----<br />
=[http://ecoquvejoz.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
----<br />
=[http://ecoquvejoz.co.cc CLICK HERE]=<br />
----<br />
</div><br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|__TOC__||'''Installing Moodle on 4.0-Mona'''<br />
|}<br />
'''Introduction'''<br />
<br />
This step-by-step guide shows how to install Moodle on Uniform Server V4.0-Mona. In addition shows how to resolve fixed paths allowing Moodle to be run from a USB memory stick.<br />
<br />
Windows does not support true cron jobs hence I have included a portable-cron solution catering for both hard drive and USB memory stick installations. <br />
<br />
== Pre-Installation ==<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|<br />
'''''Install Uniform server'''''<br />
<br />
# '''A)''' Create a new folder named '''moodle_b''' (Can be any name)<br />
# Extract a new copy of Uniform Server V4.0-Mona to this folder&lt;br&gt;(Double click on file to extract). <br />
<br />
'''''Download Moodle''''' <br />
&lt;ol start=&quot;4&quot;&gt;<br />
&lt;li&gt; '''B)''' Create a new folder '''moodle_a''' (Can be any name its only a temporary folder)&lt;/li&gt;<br />
&lt;li&gt; Download the latest version (moodle-weekly-19.zip) of Moodle from [http://download.moodle.org/ Moodle download page]&lt;/li&gt;<br />
&lt;li&gt; Copy the file dowloaded ('''moodle-weekly-19.zip''') to '''moodle_a'''&lt;/li&gt;<br />
&lt;li&gt; Unzip '''moodle-weekly-19.zip''' into this folder.&lt;br&gt;(Right click on file, select extract all, extract to current path.)&lt;/li&gt;<br />
&lt;/ol&gt;<br />
'''''Copy files to Uniform Server'''''<br />
&lt;ol start=&quot;8&quot;&gt;<br />
&lt;li&gt; '''C)''' Expand the folder '''moodle-weekly-19'''&lt;/li&gt;<br />
&lt;li&gt; '''D)''' Copy folder '''moodle''' to Uniform Servers's root folder '''www'''&lt;/li&gt;<br />
&lt;/ol&gt;<br />
|<br />
[[Image:Moodle_1.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Create a Moodle Database ==<br />
Creating the Moodle database is straight forward, tables are automatically inserted during installation<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|<br />
{|<br />
|-<br />
|valign=&quot;top&quot;|<br />
# Start Uniform Server (Double click on '''Server_Start.bat''' in folder UniServer).<br />
# From apanel (displayed in your browser when the server starts) click on the '''phpMyAdmin''' link. (left menu under tools) Note you can always return to apanel by typing &lt;nowiki&gt;http://localhost/apanel/&lt;/nowiki&gt; into your browser address bar.<br />
# '''A)''' We want to create a new database. Enter '''moodle'''<br />
# '''B)''' Click on '''Create''' to create the database<br />
|}<br />
|valign=&quot;top&quot;|<br />
[[Image:Moodle_2.gif]]<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Moodle Installation ==<br />
All that remains is to run the Moodle installer script '''install.php'''. Type the following into your browser address bar.<br />
<br />
'''&lt;nowiki&gt;http://localhost/moodle/install.php&lt;/nowiki&gt;'''<br />
<br />
Most of the pages display information just click either the next or continue button to proceed to the next page.<br />
Item 4 requires the database user name and password for a personal installation we are using the defaults '''root''' and '''root'''. The following shows what to expect during installation:<br />
<br />
{|<br />
|-<br />
|<br />
1) '''''Choose a Language'':''' Select your language e.g. English (en) click '''Next'''<br />
|-<br />
|<br />
2) '''''Checking your PHP Settings'':''' passes all click '''NEXT'''<br />
<br />
Your server should pass all these tests to make Moodle run properly <br />
{|<br />
|-<br />
|&amp;nbsp;&amp;nbsp;&amp;nbsp;||PHP version||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||Session Auto Start||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||Magic Quotes Run Time||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||Insecure Handling of Globals||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||Safe Mode||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||File Uploads||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||GD version||&amp;nbsp;||Pass<br />
|-<br />
|&amp;nbsp;||Memory Limit||&amp;nbsp;||Pass<br />
|}<br />
|-<br />
|<br />
3) '''''Please confirm the locations of this Moodle installation'':'''<br />
* Web address &lt;nowiki&gt;http://localhost/moodle&lt;/nowiki&gt;<br />
* Moodle Directory &lt;nowiki&gt;Z:\www\moodle&lt;/nowiki&gt; Grayed out<br />
* Data Directory Z:\/moodledata<br />
For a default installation of Uniform Server these are correct click '''Next'''<br />
|-<br />
|<br />
4) '''''Database configuration'':'''<br />
{|<br />
|-<br />
|&amp;nbsp;&amp;nbsp;&amp;nbsp;||Type:||&amp;nbsp;||'''MySQL'''(mysql)||&amp;nbsp;<br />
|-<br />
|&amp;nbsp;||Host Server:||&amp;nbsp;||'''localhost'''||&amp;nbsp;<br />
|-<br />
|&amp;nbsp;||User:||&amp;nbsp;|| '''root'''|| -- (Uniform Servers default)<br />
|-<br />
|&amp;nbsp;||Password:||&amp;nbsp;|| '''root'''|| -- (Uniform Server default)<br />
|-<br />
|&amp;nbsp;||Tables prefix:||&amp;nbsp;||''' mdl_'''||&amp;nbsp;<br />
|<br />
|}<br />
Click '''Next'''<br />
|-<br />
|<br />
5) '''''Checking your environment'':'''<br />
{|<br />
|-<br />
|'''Name'''||&amp;nbsp;||'''Information'''||&amp;nbsp;||'''Report'''||&amp;nbsp;||'''Status'''<br />
|-<br />
|unicode||&amp;nbsp;||&amp;nbsp;||&amp;nbsp;||must be installed and enabled||&amp;nbsp;||OK<br />
|-<br />
|database||&amp;nbsp;||mysql||&amp;nbsp;||version 4.1.16 is required and you are running 5.1.30||&amp;nbsp;||OK<br />
|-<br />
|php||&amp;nbsp;||&amp;nbsp;||&amp;nbsp;||version 4.3.0 is required and you are running 5.2.8||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||iconv||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||mbstring||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||curl||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||openssl||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||tokenizer||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||xmlrpc||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|-<br />
|php_extension||&amp;nbsp;||ctype||&amp;nbsp;||should be installed and enabled for best results||&amp;nbsp;||OK<br />
|}<br />
|-<br />
|<br />
6) '''''Download language pack Installation'':''' Option to download a language pack '''NEXT'''<br />
|-<br />
|<br />
7) '''''Configuration completed'':''' config.php has been successfully created '''Continue'''<br />
|-<br />
|<br />
8) '''''GPL License'':''' You have read the copyright notice! '''YES'''<br />
|-<br />
|<br />
9) '''''Current release information''''': Moodle 1.9.4+ (Build: 20090204)(leave Unattended operation un-checked): '''Continue'''<br />
|-<br />
|<br />
10) '''''Setting up database'':''' Takes some time wait as the install takes place: Database was successfully updated '''Continue'''<br />
|-<br />
|<br />
11) '''''Setting up module tables'':''' Again wait, Workshop tables have been setup correctly '''Continue'''<br />
|-<br />
|<br />
12) '''''Setting up plugin tables'':''' Truefalse tables have been set up correctly, '''Continue'''<br />
|-<br />
|<br />
13) '''''Upgrading database'':''' Datbase was successfully upgraded '''Continue'''<br />
|-<br />
|<br />
14) '''''Upgrading database'':''' Blocks version is now 2007081300 '''Continue'''<br />
|-<br />
|<br />
15) '''''Setting up block tables'':''' '''Continue'''<br />
|-<br />
|<br />
16) '''''Setting up plugin tables'':''' Paypal tables have been set up correctley '''Continue'''<br />
|-<br />
|<br />
17) '''''Setting up plugin tables'':''' xml and other plugins set up correctly '''Continue'''<br />
|-<br />
|<br />
18) '''''Setting up plugin tables'':''' xml tables have been set up correctly '''Continue'''<br />
|-<br />
|<br />
19) '''''Setting up plugin tables'':''' user tables have been set up correctly '''Continue'''<br />
|-<br />
|<br />
20) '''''Setting up plugin tables'':''' stats tables have been set up correctly '''Continue'''<br />
|-<br />
|<br />
21) '''''Setting up plugin tables'':''' unittest tables have been set up correctly '''Continue'''<br />
|-<br />
|<br />
22) '''''Setup administrator account'':'''<br />
<br />
Admin set-up: On this page you should configure your main administrator account which will have complete control over the site. Make sure you give it a secure user name and password as well as a valid email address. You can create more admin accounts later on. Fill in details:<br />
{|<br />
|-<br />
|Username:|| '''boss'''<br />
|-<br />
|New password|| '''fred123'''<br />
|-<br />
|First name:|| '''Fred'''<br />
|-<br />
|Surname:|| '''Smith'''<br />
|-<br />
|Email address:|| '''fred@smith.com'''<br />
|-<br />
|Email display:|| Hide my Email address from everyone<br />
|-<br />
|Email activated:|| This email address is enabled<br />
|-<br />
|City/Town:|| '''Cambridge'''<br />
|-<br />
|Select acountry:|| '''United Kingdom'''<br />
|-<br />
|Timezone:|| Server's local time<br />
|-<br />
|Prefered language:||English<br />
|-<br />
|Leave rest blank||&amp;nbsp;<br />
|}<br />
Click '''Update profile'''<br />
|-<br />
|<br />
23) '''''Front Page settings'':'''<br />
<br />
This page allows you to configure the front page and name of this new site. You can come back here later to change these settings any time using the Administration menus. Fill in details:<br />
<br />
* Full site name: '''MPG Test'''<br />
* Short name: '''MPG'''<br />
* Front page description: '''Personal installation of Moodle running on Uniform Server 4.0-Mona'''<br />
* New settings - Manage authentication: '''Disabled'''<br />
* Click: '''save changes'''<br />
|-<br />
|<br />
24) '''''Finished'':'''<br />
<br />
This is your main admin page you can continue setting up Moodle or log out<br />
|}<br />
<br />
'''''Note'':''' Steps 22-23 I entered dummy information. You can change this information from admin at any time, however make sure you remember your admin password and name.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Stopping Moodle ==<br />
# Logout from admin<br />
# Double click on '''Stop.bat''' located in folder '''G:\Uniform Server''' <br />
<br />
'''''[[#top | Top]]'''''<br />
== Starting Moodle ==<br />
# Double click on '''Server_Start.bat''' located in folder '''G:\Uniform Server'''<br />
# In your browser address bar type '''&lt;nowiki&gt;http://localhost/moodle/&lt;/nowiki&gt;'''<br />
<br />
'''''Note'':''' You can run apanel at any time by typing &lt;nowiki&gt;http://localhost/apanel&lt;/nowiki&gt; into your browser address bar.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Portability Memory Stick ==<br />
To run Moodle from a Memory stick, copy the folder '''UniServer''' and all its content to whatever drive your memory stick is on.<br />
<br />
'''''Note'':''' This process is not fast; writing 102 MB (UniServer plus Moodle) took just over 20 minutes. In the same vain do not expect exceptional performance, Moodle uses a large database hence is slow when run from a memory stick. That said I found it just about acceptable.<br />
<br />
=== Hard Coded path ===<br />
During installation Moodle uses the drive letter (default Z) it is installed from and hard wires it into a configuration file. This means you cannot run or move the installation and expect Moodle to run. A solution to this problem requires modifying the Moodle configuration file config.php.<br />
<br />
Open the following file in a text editor:<br />
<br />
UniServer\udrive\www\moodle\'''config.php''' <br />
<br />
Its a small file locate the following two lines:<br />
&lt;pre&gt;<br />
$CFG-&gt;dirroot = 'Z:\www\moodle';<br />
$CFG-&gt;dataroot = 'Z:\/moodledata';<br />
?&gt;<br />
&lt;/pre&gt; <br />
The hard coded paths start with '''Z:''' the solution is to let PHP calculate this drive letter (path) by replacing the above two lines with:<br />
&lt;pre&gt;<br />
$root= substr($_SERVER[&quot;DOCUMENT_ROOT&quot;],0,-4);<br />
$CFG-&gt;dirroot = $root.'\www\moodle';<br />
$CFG-&gt;dataroot = $root.'\/moodledata';<br />
?&gt;<br />
&lt;/pre&gt; <br />
The above change makes Moodle completely portable.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Cron ==<br />
Moodle has a '''cron.php''' script that needs to be periodically run. It takes care of various routine tasks for example unsubscribing inactive members and sending out email messages.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Manualy Run Cron ===<br />
To keep Moodle happy you need to periodically run the '''cron.php''' script.<br />
<br />
For a personal implementation of Moodle you can run cron.php occasionally by typing the following into your browser address bar:<br />
<br />
'''&lt;nowiki&gt;http://localhost/moodle/admin/cron.php&lt;/nowiki&gt;'''<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Automatically Run Cron ===<br />
Manually running Cron can become tedious a solution is to create a portable-cron using 4.0_Mona components, three new files are required as follows: <br />
<br />
'''''[[#top | Top]]'''''<br />
=== run_cron.php ===<br />
This file runs the actual cron script '''cron.php''' its sole purpose is to convert local paths to server relative paths. <br />
<br />
UniServer\udrive\www\moodle\admin\'''run_cron.php'''<br />
&lt;pre&gt;<br />
&lt;? $dummy = file(&quot;http://localhost/moodle/admin/cron.php&quot;); ?&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== run_cron.bat ===<br />
This batch file uses '''unidelay.exe''' to provide a periodic tick. At the end of each delay PHP is run in CLI mode and runs script run_cron.php. the loop repeats indefinitely. <br />
<br />
UniServer\'''run_cron.bat'''<br />
&lt;pre&gt;<br />
:next<br />
udrive\home\admin\program\unidelay.exe 60<br />
udrive\usr\local\php\php.exe -n udrive\www\moodle\admin\run_cron.php<br />
goto :next<br />
exit<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== run_cron_hidden.bat ===<br />
The above batch file if run directly would be visible hence this batch file uses '''uniserv.exe''' to run the above hidden. <br />
<br />
UniServer\'''run_cron_hidden.bat'''<br />
&lt;pre&gt;<br />
start udrive\home\admin\program\uniserv.exe run_cron.bat<br />
&lt;/pre&gt;<br />
<br />
With the files in place start the servers and run '''run_cron_hidden.bat'''. <br />
<br />
'''''Note 1'':''' '''unidelay.exe 60''' runs the cron-job every 60 seconds increase this as required.<br />
<br />
'''''Note 2'':''' You can run Cron from '''Server_Start.bat''' add the following line just below line ''':END''' (forth line from bottom of file):<br />
&lt;pre&gt;<br />
start udrive\home\admin\program\uniserv.exe run_cron.bat<br />
&lt;/pre&gt;<br />
Hence every time you start the servers using '''Server_Start.bat''' or '''disk_start.vbs''' Cron will run. <br />
<br />
'''''Related links'':'''<br />
<br />
[http://docs.moodle.org/en/Cron Moodle Docs Cron]<br />
<br />
[[Portable Cron | Portable Cron]]<br />
<br />
[[LCC-win32: Drupal Cron | LCC portable cron program]]<br />
<br />
'''''[[#top | Top]]''''' <br />
== Tip - UniServer on a laptop ==<br />
I lifted the following tip straight from [http://www.teachageek.com/2009/03/uniform-server-revisited.html '''gdunc'''] blog, it looks very useful, reproduced unedited:<br />
<br />
One other thing that might be useful to add here is a small addition to the config.php file for those users who use UniServer on a laptop. Since the '''config.php''' file lists the wwwroot as &quot;localhost&quot; external users are unable to view your moodle site correctly. For that reason, I would recommend the following changes to config.php:<br />
<br />
Locate the 'wwwroot' line in '''config.php'''<br />
&lt;pre&gt;<br />
$CFG-&gt;wwwroot = 'http://localhost/moodle';<br />
&lt;/pre&gt;<br />
Replace the above line with the following two lines, to let php figure out what your current IP address is and change it whenever your IP address changes. This can be very useful when moving from event to event.<br />
&lt;pre&gt;<br />
$domain = GetHostByName($REMOTE_ADDR);<br />
$CFG-&gt;wwwroot = 'http://'.$domain.'/moodle';<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
Although there are a large number of steps Moodle is easy to install on Uniform Server.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 4.0-Mona]]<br />
[[Category: Installation]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_cURL:_CLI_DtDNS_Updater_1&diff=4697PHP cURL: CLI DtDNS Updater 12010-11-24T06:15:38Z<p>Upazixorys: </p>
<hr />
<div>=[http://ovarynetyv.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
{{Nav PHP cURL}}<br />
'''cURL CLI DtDNS Updater - Part 1'''<br />
<br />
Boundaries between CLI and Server scripting at times are a little blurred it can be easier to develop scripts on a server that are destined for CLI implementation.<br />
<br />
This page is no exception, on our simulation server we are going to look at simulating DtDNS’s update page. It’s easier to see what’s going on if we use a test server to access this page using Curl and then convert the script to CLI.<br />
<br />
Simulation has the advantage all testing is local removing bandwidth from live servers and possibly incurring the wroth of a draconian dragon (having your IP address band from their servers). <br />
<br />
== Background ==<br />
Any provider worth their salt will provide material necessary to use their service. It should be easily accessible for example perform a Goggle search for “dtdns IP updater specification” hey that’s neat gives http://www.dtdns.com/specs.txt try that with “dyndns IP updater specification”<br />
<br />
OK Not so easy, but the information is there http://www.dyndns.com/developers/specs/ and http://www.dyndns.com/developers/<br />
<br />
Anyway my point is you need a specification otherwise you cannot create a simulation script. We are targeting DtDNS have the specification how often does it change, always a reasonable indicator that they have not got it right. OK last changed 02/12/05 although internal server operation may change the external user interface has not.<br />
<br />
That means you can reliably code to their specification.<br />
<br />
== Simulation Script Information ==<br />
Ideally we would like to test against a real page however after reading the specification transpires a ColdFusion template is used. This has been configured in such a way to the outside world it looks like a CGI script were values are passed using the GET method.<br />
<br />
This template is accessed using one of two URLs<br />
* &lt;nowiki&gt;http://&lt;/nowiki&gt;www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password&amp;'''ip'''=address&amp;'''client'''=name<br />
* &lt;nowiki&gt;https://&lt;/nowiki&gt;www.dtdns.com/api/autodns.cfm?'''id'''=hostname&amp;'''pw'''=password&amp;'''ip'''=address&amp;'''client'''=name<br />
<br />
Although it is possible to run files with extension cfm as PHP scripts its easier to just use a php extension. Anyway there is nothing to prevent us creating a simulation script. <br />
<br />
For connivance I have reproduced part of the specification for name-value pairs and returned messages below (Note I added message 8 this seems to have been missed from the spec.):<br />
<br />
'''''[[#top | Top]]'''''<br />
=== name-value pairs ===<br />
{|cellspacing=&quot;6&quot;<br />
|-valign=&quot;top&quot;<br />
|<br />
1)<br />
|<br />
'''id=hostname'''<br />
|<br />
This is a required field that will specify what the member's hostname (or domain) is. This value should ALWAYS be a fully qualified domain name. It should be a sub domain of one of the available DtDNS domains, or a full domain that DtDNS is hosting. Please check the hostname for invalid characters and spit out an error if you find any. See O'Reilly's DNS and BIND 3rd ed. for a complete discussion on what characters are and aren't valid in hostnames and domain names.<br />
<br />
* NOTE: Hostnames are now passed using the full hostname and the domain name it's on, not just the hostname (ex:test.dtdns.net, myhost.etowns.org, etc.). Full domain names are passed using just the domain name (ex: blah.com, mydomain.net, etc.).<br />
|-valign=&quot;top&quot;<br />
|<br />
2)<br />
|<br />
'''pw=password'''<br />
|<br />
This is a required field that will specify the member's password. This will be compared to what is stored in the userbase for the specified hostname. If they do not match, an error (specified below) will be returned.<br />
|-valign=&quot;top&quot;<br />
|<br />
3)<br />
|<br />
'''ip=address'''<br />
|<br />
This field will specify what IP address to update to. If no IP field is specified, the server will take the IP address the request was recieved from.<br />
<br />
We will attempt to determine if the user is behind a proxy server by testing several common header variables.<br />
<br />
We recommend giving the user the option of not sending the IP address with IP updates if they are behind a NAT router. Hardware clients that do not act as a direct bridge should send the user's WAN address, and hardware clients that act as bridges should not send an IP address.<br />
<br />
DtDNS now provides an &quot;offline IP&quot; for our members to use. By pointing their hostname or domain to this IP address, anyone trying to visit their web site on port 80 will see a standard offline message or be redirected to a URL configured via the web site. The offline IP address is 0.0.0.0.<br />
|-valign=&quot;top&quot;<br />
|<br />
4)<br />
|<br />
'''client=name'''<br />
|<br />
This is an OPTIONAL parameter to include the name of your update clinet. Please keep this under 10 characters, and all in one word if possible. This can be used for tracking purposes, and general statistics. 'Unknown' will be placed in the database if no client is specified. If you use the User-Agent HTTP header, please use the same value in this field.<br />
|}<br />
'''''[[#top | Top]]'''''<br />
=== returned messages ===<br />
{|<br />
|-valign=&quot;top&quot;<br />
|&amp;nbsp;||'''''Messages'''''||'''''Description'''''<br />
|-valign=&quot;top&quot;<br />
|<br />
1)<br />
|<br />
No hostname to update was supplied.<br />
|<br />
This message is returned when no ID is specified.<br />
|-valign=&quot;top&quot;<br />
|<br />
2)<br />
|<br />
No password was supplied.<br />
|<br />
Returned when no PW is given.<br />
|-valign=&quot;top&quot;<br />
|<br />
3)<br />
|<br />
The hostname you supplied is not valid.<br />
|<br />
Returned when ID is not a valid hostname or domain on the system.<br />
|-valign=&quot;top&quot;<br />
|<br />
4)<br />
|<br />
The password you supplied is not valid.<br />
|<br />
Returned when the value of PW does not match the password defined for the value in the ID tag.<br />
|-valign=&quot;top&quot;<br />
|<br />
5)<br />
|<br />
This account has not yet been activated.<br />
|<br />
Returned when the account has not been activated for usage.<br />
|-valign=&quot;top&quot;<br />
|<br />
6)<br />
|<br />
Administration has disabled this account.<br />
|<br />
Returned when the disabled bit is active for the specified ID, meaning that the hostname&lt;br /&gt;<br />
or domain name has been disabled for some reason.<br />
|-valign=&quot;top&quot;<br />
|<br />
7)<br />
|<br />
Illegal character in IP.<br />
|<br />
Returned when a non-numeric or period character is detected in the IP field when the user&lt;br /&gt;<br />
has their account setup for A name resolution. Having a non-standard IP when set to A&lt;br /&gt;<br />
resolution causes the service to not update the IP database. Also returned when a number&lt;br /&gt;<br />
in the IP address is higher than 255.<br />
|-valign=&quot;top&quot;<br />
|<br />
8)<br />
|<br />
Host '''''name''''' now points to '''''IP'''''<br />
|<br />
Returned when an update is accepted (IP changed). For example<br />
<br />
Host '''fred-test.dtdns.net''' now points to 888.129.139.179<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Valid Names and Labels ==<br />
Although things have moved on there are still implementation that use the old RFC 952 and RFC 1123 (1999!) specification that define what a valid name (Label) is. Note a domain in this context includes any sub-domains eg fred.dtdns.net = (label).(label).net <br />
<br />
Labels can contain letters, numbers, and hyphens, and may not start with a hyphen. Periods are used to separate labels in a domain<br />
name. The total length must range between 3 and 63 characters (excluding the extension).<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
A to Z ; upper case characters<br />
a to z ; lower case characters<br />
0 to 9 ; numeric characters 0 to 9<br />
- ; dash<br />
&lt;/pre&gt;<br />
|<br />
* A label can start or end with a letter or a number<br />
* A label MUST NOT start or end with a '-' (dash)<br />
* A label MUST NOT consist of all numeric values<br />
* A label can be up to 63 characters<br />
|}<br />
The above is a safe bet, however specification RFC 2181 provides expanded capabilities and essentially says anything goes,<br />
<br />
If you want to validate to RFC 2181 be prepared for some real pain!<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Example client host validation ===<br />
The follow examples shows code you could use for client verification. Expert regexer’s probably can do this in a single line. I like to split into small more manageable chunks.<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
<br />
$host = &quot;uniserver-test.dtdns.net&quot;; // Change this for testing<br />
<br />
// === Check for vailid host =================================================<br />
$failed=false;<br />
if(preg_match(&quot;/^[A-Za-z0-9\-.]+$/&quot;,$host)){ // Allowed characters<br />
<br />
// Invalid period either end not allowed set flag<br />
if(preg_match(&quot;/^[.]/&quot;,$host)|preg_match(&quot;/[.]$/&quot;,$host)){<br />
$failed=true; <br />
} <br />
<br />
// Looks ok now split at periods to give array each element contains a Label <br />
else{ <br />
$host_array = explode(&quot;.&quot;,$host); // into an array<br />
<br />
// Scan each element for &quot;-&quot; either end of element not allowed set flag <br />
foreach($host_array as $el){ <br />
if(preg_match(&quot;/^-/&quot;,$host)|preg_match(&quot;/-$/&quot;,$el)){<br />
$failed=true; // not allowed set flag <br />
} <br />
}// end foreach<br />
<br />
// Last element is tld allowed characters lower cae alpha <br />
if(!preg_match(&quot;/^[a-z]+$/&quot;,end($host_array))){<br />
$failed=true; <br />
}<br />
}// end ese<br />
}// end if allowed characters<br />
<br />
if($failed){<br />
print &quot;&lt;br /&gt;==== Errors In Host =======&lt;br /&gt;&quot;;<br />
exit;<br />
}<br />
// === END Check for vailid host =============================================<br />
print &quot;&lt;br /&gt;=== Host OK =====&lt;br /&gt;&quot;;<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
== Simulation Script ==<br />
Our simulation script as a minimum should validate all mandatory values and any additional items you consider important its a personal choice. Remember its the Curl script we want to check.<br />
<br />
That said because DtDNS has provided an excellent and easy to understand specification its worth matching responses as outlined. The following is my attempt at a working simulation script:<br />
<br />
Create a new text file in folder C:\curl_2\UniServer\'''www''' named '''autodns.php''' with the following content:<br />
<br />
'''autodns.php'''<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$hostname = &quot;uni.dtdns.net&quot;; // Host name you created at DtDNS<br />
$password = &quot;me123&quot;; // Account password you set<br />
<br />
$information = true; // true = display information false = for real tests set to false<br />
$activated = true; // Account active = true, Account not active = false<br />
$account_disabled = false; // Admin disabled = true, not disabled = false<br />
<br />
if($information){<br />
print &quot;&lt;p&gt;&lt;b&gt;Information&lt;/b&gt;&lt;/p&gt;&quot;;<br />
$id=$pw=$ip=$client=NULL;<br />
if(isset($_GET['id'])) $id = $_GET['id'];<br />
if(isset($_GET['pw'])) $pw = $_GET['pw'];<br />
if(isset($_GET['ip'])) $ip = $_GET['ip'];<br />
<br />
// Check if a client was supplied<br />
if(isset($_GET['client'])){<br />
$client = $_GET['client'];<br />
}<br />
else{<br />
$client = &quot;Unknown&quot;;<br />
}<br />
<br />
print &quot;&amp;lt;pre&amp;gt;Host (id) = $id&lt;br /&gt;&quot;;<br />
print &quot;Password (pw) = $pw&lt;br /&gt;&quot;;<br />
print &quot;Ip (ip) = $ip&lt;br /&gt;&quot;;<br />
print &quot;Client (client)= $client &amp;lt;/pre&amp;gt;&quot;;<br />
}//End Information<br />
<br />
// === Check for id host name<br />
if(isset($_GET['id'])){<br />
$id = $_GET['id'];<br />
}<br />
else{<br />
print &quot;No hostname to update was supplied.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check for pw host name<br />
if(isset($_GET['pw'])){<br />
$pw = $_GET['pw'];<br />
}<br />
else{<br />
print &quot;No password was supplied.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check id (hostname) matches<br />
if($id!=$hostname){<br />
print &quot;The hostname you supplied is not valid.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check pwd matches<br />
if($pw!=$password){<br />
print &quot;The password you supplied is not valid.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check if account activated<br />
if(!$activated){<br />
print &quot;This account has not yet been activated.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check if Admin disabled account<br />
if($account_disabled){<br />
print &quot;Administration has disabled this account.&quot;;<br />
exit;<br />
}<br />
<br />
// === Check if a IP was supplied<br />
if(isset($_GET['ip'])){<br />
$ip = $_GET['ip'];<br />
<br />
// === Validate<br />
if(!preg_match(&quot;/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/&quot;,$ip)){<br />
print &quot;Illegal character in IP&quot;;<br />
exit;<br />
}<br />
}<br />
else{<br />
//Gets the IP address<br />
$ip = getenv(&quot;REMOTE_ADDR&quot;) ;<br />
}<br />
<br />
print &quot;Host $id now points to $ip.&quot;;<br />
?&gt;<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
Start server '''curl_2''' copy and paste the following into your browser address bar:<br />
&lt;pre&gt;<br />
http://localhost:82/autodns.php?id=uni.dtdns.net&amp;pw=me123&amp;ip=11.22.33.44&amp;client=UniServerV1<br />
&lt;/pre&gt;<br />
Browser displays:<br />
&lt;pre&gt;<br />
Information<br />
<br />
Host (id) = uni.dtdns.net<br />
Password (pw) = me123<br />
Ip (ip) = 11.22.33.44<br />
Client (client)= UniServerV1<br />
<br />
Host uni.dtdns.net now points to 11.22.33.44.<br />
&lt;/pre&gt;<br />
Change the variables and generally check whats displayed.<br />
<br />
When you have finished testing set '''$information = false;''' the simulation script hide the extra information.<br />
<br />
Note: If you are simulaing a real DtDNS account remember to change the following:<br />
* '''$hostname''' = &quot;uni.dtdns.net&quot;; // Host name you created at DtDNS<br />
* '''$password''' = &quot;me123&quot;; // Account password you set<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
The above simulation script is important it allows you to make mistakes while testing without incurring the wrath of a draconian dragon. I am not sure what form DtDNS’s dragon takes however I do know DynDNS implements an abuse counter once triggered time delayed logins starts. <br />
<br />
With the above in place we can develop our Curl update script on test server curl_1 and convert to CLI, this is covered on the [[PHP cURL: CLI DtDNS Updater 2 | '''next page''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Admin_Panel_2:_Admin_Virtual_Host&diff=4696Admin Panel 2: Admin Virtual Host2010-11-24T06:15:31Z<p>Upazixorys: </p>
<hr />
<div>=[http://yxiwisewava.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Uc_nav_apanel2}}<br />
'''Admin Virtual Host'''<br />
<br />
Name based virtual hosting allows you to host and/or develop more than one web site on your Apache server. Its main advantage is that only one fixed IP is required to host several sites, hence preserving those valuable IP addresses. This tool simplifies setting up the Apache configuration and local host files by making that process transparent.<br />
<br />
'''Error'''<br />
<br />
When you first start this page you will find a host named '''localhost:80''' followed by one error message. In reality this error message is just a warning and can be safely ignored. Note: localhost:80 is a dummy server name. If you are hosting one web site under one domain name there is no need to use virtual hosting. You should be using the normal set-up explained in Apache Configuration [[Admin Panel 2: Apache Configuration#Server Name|Server Name]]. <br />
<br />
== Virtual hosting ==<br />
Virtual hosting allows you to host more than one domain name using a single IP address or to host several sites with a common domain name.<br />
<br />
'''Related:'''<br />
<br />
* [[Virtual Hosting: Home| Root folders]] - Where to place your files for each host<br />
* [[Virtual Hosting: Name based| Name based]] - How to set up Virtual Hosts<br />
<br />
'''''[[#top | Top]]'''''<br />
== Log files ==<br />
Uniform Server, by default, logs all errors and accesses to the server in the following two files '''error.log''' and '''access.log''', respectively located in folder *\Uniform Server\udrive\usr\local\apache2\logs you may prefer to have separate logs for each virtual host.<br />
<br />
To have separate logs when filling in the Admin Virtual Host form (Optional additions) you add the following two lines to each virtual host:<br />
<br />
{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
ErrorLog logs/name_error.log&lt;br&gt;<br />
CustomLog logs/name_custom.log '''combined'''<br />
|}<br />
<br />
The file names '''name_error.log''' and '''name_custom.log''' can be anything you like. I would recommend you use site folder names, since it makes administration easier.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== CustomLog Directive ===<br />
The CustomLog Directive takes three parameters: file name, format (what to log) and environment. The first two are required and the third is optional.<br />
<br />
The second parameter specifies what will be written to the log file (if this is missing, it prevents the server running) UniServer has the following defined:<br />
<br />
{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
LogFormat &quot;%h % %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; '''combined'''&lt;br&gt;<br />
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b&quot; '''common'''&lt;br&gt;<br />
LogFormat &quot;%{Referer}i -&gt; %U&quot; '''referer'''&lt;br&gt;<br />
LogFormat &quot;%{User-agent}i&quot; '''agent'''<br />
|} <br />
<br />
Each format string ends with a name (combined, common, referer and agent). These are short cuts containing the corresponding format string. You use this name as the second parameter for each custom log.<br />
<br />
{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
ErrorLog logs/name_error.log&lt;br&gt;<br />
CustomLog logs/name_custom.log '''combined'''<br />
|}<br />
<br />
Alternatively you can us a format string directly:<br />
<br />
{| cellpadding=&quot;8&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|style=&quot;background:#f5f5f5;&quot;|<br />
ErrorLog logs/name_error.log&lt;br&gt;<br />
CustomLog logs/name_custom.log '''&quot;%h % %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot;'''<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Example ===<br />
Using example sites taken from this page [[Virtual Hosting: Name based|Virtual Hosting - Name based]]:<br />
<br />
{|cellpadding=&quot;4&quot;<br />
|-style=&quot;background:#cccccc&quot;<br />
!Name:<br />
!Path to DoucumentRoot<br />
!Optional additions<br />
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;<br />
|www.my_site1.fredtest.mine.nu<br />
|I:/site1 <br />
|ErrorLog logs/site1_error.log<br />
CustomLog logs/site1_custom.log combined<br />
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;<br />
|www.my_site2.fredtest.mine.nu<br />
|/z_www/site2<br />
|ErrorLog logs/site2_error.log<br />
CustomLog logs/site2_custom.log combined<br />
|-valign=&quot;top&quot; style=&quot;background:#f8f8f8&quot;<br />
|www.ric.com<br />
|/z_www/site3 <br />
|ErrorLog logs/site3_error.log<br />
CustomLog logs/site3_custom.log combined<br />
|} <br />
<br />
Open the file '''httpd.conf''' located in folder '''*\Uniform Server\udrive\usr\local\apache2\conf''' . The virtual host entries are added to the end of this file.<br />
<br />
The first line NameVirtualHost * enables Apache for virtual host operation. If you comment out this line by adding &quot;#&quot; it disables all the hosts you have configured.<br />
<br />
'''''Note 1'':'''&lt;br&gt;Each section now contains the appropriate log directives. Apache will automatically create the log files (in folder *\Uniform Server\udrive\usr\local\apache2\logs) when each site is accessed or when an error is produced.<br />
<br />
'''''Note 2'':'''&lt;br&gt;If Apache does not need to write to a file, it is not created.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Important notes ==<br />
'''''Note 1'':'''&lt;br&gt;The program automatically un-comments the line '''NameVirtualHost *''' . If you have previously used virtual hosts and decide to run the server with no virtual hosts you must manually re-insert this comment.<br />
<br />
# Open file: '''httpd.conf'''<br />
# Located in folder: '''*\Uniform Server\udrive\usr\local\apache2\conf'''<br />
# Towards the end of the file locate the line: '''NameVirtualHost *'''<br />
# Comment the line to look like this: '''#NameVirtualHost *'''<br />
# Save file and '''restart server'''<br />
<br />
'''''Note 2'':'''&lt;br&gt;Not transportable<br />
<br />
When you have created your virtual hosts, view your sites by typing the real web-site name into your browser address bar. For example www.mpgautos.com will serve pages from the site1 folder. If you copy Uniform Server and your sites to a memory stick, do not be surprised if they no longer work when run on a different machine. You need to copy the Windows hosts entries to the machine you are running on. However if this is inconvenient then this link may help [[Virtual Hosting: PAC|Virtual Hosting &amp; PAC]].<br />
<br />
'''''Note 3'':'''&lt;br&gt;Common problems<br />
<br />
*If you find the servers no longer run after creating a Vhost with separate logs, make sure you have included a second parameter for the custom log.<br />
*Make sure all file paths do not end with a forward slash.<br />
*Make sure the line NameVirtualHost * is uncommented.<br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: About]]<br />
[[Category: Facts]]<br />
[[Category: Troubleshooting]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=SlimFTPd:_Config_Anonymous&diff=4689SlimFTPd: Config Anonymous2010-11-24T01:20:35Z<p>Upazixorys: </p>
<hr />
<div>=[http://exytebuc.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
&lt;div style=&quot;padding:0;margin:0; border-bottom:3px inset #000000&quot;&gt;<br />
{| <br />
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||<br />
SlimFTPd: <br />
[[SlimFTPd: Home | Home]] | <br />
[[SlimFTPd: Tutorial | Tutorial]] | <br />
[[SlimFTPd: Clients | Clients]] | <br />
[[SlimFTPd: Config File | Config File]] | <br />
[[SlimFTPd: Config Anonymous | Config Anonymous]] | <br />
[[SlimFTPd: Plugins | Plugins]] | <br />
<br />
|}<br />
&lt;/div&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
'''Anonymous user configuration.'''<br />
|}<br />
For the majority of Internet users, FTP’s real power is transparent. At the click of a link, they can initiate an FTP server download; these users are anonymous never needing to provide a user name and password.<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|<br />
This part of the tutorial covers using SlimFTPd for anonymous user access. It is extremely easy to set up, provide a user profile with user name set to “'''anonymous'''” with a '''blank password''' and restrict '''access''' to '''read''' as shown to the right.<br />
|<br />
'''&lt;User&amp;nbsp;&quot;anonymous&quot;&gt;'''&amp;nbsp;&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Password &quot;&quot;'''&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;Some&amp;nbsp;folder&amp;nbsp;&amp;nbsp;&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Deny /All'''&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Allow / Read'''&lt;br&gt;<br />
'''&lt;/User&gt;'''<br />
|}<br />
<br />
That essentially completes this part of the tutorial! If you are interested in a little more detail or want to run some examples read on.<br />
<br />
== Anonymous user profile 1 ==<br />
I have a folder containing wave music files and would like to make these downloadable from a web page. The anonymous user profile has the following format:<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|<br />
Add the user profile on the right to the end of SlimFTPd’s configuration file.<br />
<br />
C:\uc_slimftpd_tutorial\'''slimftpd.conf'''<br />
|<br />
&lt;User &quot;'''anonymous'''&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;'''C:/uc_slimftpd_tutorial/uc_tskill/wav'''&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Deny /All&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / '''Read'''&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
<br />
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.<br />
# Type '''&lt;nowiki&gt;ftp://localhost&lt;/nowiki&gt;''' into your browser address bar.<br />
# You will receive a '''550-error''' list permission denied, not surprising because '''allow''' was set to '''read''' only. <br />
<br />
'''''Note:''''' For testing you can allow listing (Allow / Read '''List'''). This will allow you to see what’s mapped into the server root. Its not a security issue most download sites allow full listings it’s your site your choice.<br />
<br />
=== Simple test file ===<br />
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run and html page double click on its file name it will be displayed in your browser. <br />
<br />
&lt;table cellpadding=&quot;2&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
'''Links:'''<br />
<br />
The page contains two links:<br />
<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/boom_x.wav&quot;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/explosion_x.wav&quot;&lt;/nowiki&gt;<br />
<br />
'''''Note:''''' The mount command has mapped the wav folder into the server root.&lt;br&gt; This is why there are no sub-folders specified in the link construction.<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&amp;nbsp;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
! &amp;nbsp;&amp;nbsp;''C:\uc_slimftpd_tutorial\uc_tskill\test_pages\test1.html'': check.bat&amp;nbsp;&amp;nbsp;<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
| <br />
&lt;nowiki&gt;&lt;html&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;head&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;title&gt;Test1 Page&lt;/title&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/head&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;body&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;Download test:&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt; &lt;a href=&quot;ftp://localhost/boom_x.wav&quot;&gt;Download My music 1&lt;/a&gt;&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt; &lt;a href=&quot;ftp://localhost/explosion_x.wav&quot;&gt;Download My music 2&lt;/a&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/body&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/html&gt;&lt;/nowiki&gt;<br />
|}<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
<br />
Run the page (double click on test1.html), click on either of the links and your browser will offer you the choice to either play (open) or save the file to disk.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Anonymous user profile 2 ==<br />
Matching my music files I have a range of CD cover images. These are large images contained in a separate folder; I would like to make these download-able.<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|<br />
Modify SlimFTPd’s configuration as shown in bold.<br />
<br />
'''''Note:''''' I have added Allow '''List''' so you can see what is listed in the root.<br />
|<br />
&lt;User &quot;anonymous&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount / C:/uc_slimftpd_tutorial/uc_tskill/wav&lt;br&gt;<br />
'''&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/&amp;nbsp;C:/uc_slimftpd_tutorial/uc_tskill/images&amp;nbsp;'''&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Deny /All&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / Read '''List'''&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.<br />
# Type '''&lt;nowiki&gt;ftp://localhost&lt;/nowiki&gt;''' into your browser address bar.<br />
# Your browser displays the FTP servers root content.<br />
# '''BIG PROBLEM''' what happened to the wav files?. <br />
<br />
'''Problem:''' At first sight the logic looks sound, map the folders across, they contain different file formats that will not conflict. In reality you may be mapping large folders across that do contain identical file names, hence the last folder listed is mapped to prevent conflicts.<br />
<br />
'''Solution:''' For this simple case you could copy all the images into the wave file folder. However consider the consequence you have just doubled your image disk space. Earlier I mentioned these images were large now pop out and buy a new disk. The next example offers an alternative solution.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Anonymous user profile 3 ==<br />
Adding sub-folders to the server root will resolve the above problem. You can use the same name as the folders being mapped e.g. wav and images or use alternative names top_ten_music blockbuster_images.<br />
<br />
{|width=&quot;80%&quot; style=&quot;background:#333333&quot; cellpadding=&quot;4&quot; cellspacing=&quot;1&quot;<br />
|-style=&quot;background:#eeeeee&quot;<br />
|<br />
Modify SlimFTPd’s configuration as shown in bold.<br />
<br />
'''''Note:''''' The permissions of the root sub-folders '''top_ten_music''' and '''blockbuster_images''' inherit the root folders permissions &quot;Allow / Read List&quot;.<br />
|<br />
&lt;User &quot;anonymous&quot;&gt;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Password &quot;&quot;&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount /'''top_ten_music''' C:/uc_slimftpd_tutorial/uc_tskill/wav&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Mount&amp;nbsp;/'''blockbuster_images'''&amp;nbsp;C:/uc_slimftpd_tutorial/uc_tskill/images&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Deny /All&lt;br&gt;<br />
&amp;nbsp;&amp;nbsp;Allow / Read List&lt;br&gt;<br />
&lt;/User&gt;<br />
|}<br />
<br />
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.<br />
# Type '''&lt;nowiki&gt;ftp://localhost&lt;/nowiki&gt;''' into your browser address bar.<br />
# Your browser displays the FTP servers root content, no files however there are two folders:&lt;br&gt;'''top_ten_music''' and '''blockbuster_images'''<br />
<br />
'''''Illusion:''''' Well the user sees folders that do not exist on your disk.<br />
<br />
'''''Fine control:''''' The sub-folders inherit privileges from the root folder “/” hence if for whatever reasons you want to prevent images being listed you can target that sub-folder and deny listing for example Deny /blockbuster_images List <br />
<br />
=== Test file: ===<br />
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run just double click on the file name it will be displayed in your browser.<br />
<br />
&lt;table cellpadding=&quot;2&quot;&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
'''''Links:'''''<br />
<br />
The page contains four links:<br />
<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/top_ten_music/boom_x.wav&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/top_ten_music/explosion_x.wav&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/blockbuster_images/users.gif&quot;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;href=&quot;ftp://localhost/blockbuster_images/setup.gif&lt;/nowiki&gt;<br />
<br />
'''''Note:''''' The mount command has created new sub-folders '''top_ten_music''' and '''blockbuster_images''' our real folder '''wav''' and '''images''' have been mapped into these respectively. <br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&amp;nbsp;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
{| cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;background:#000000;&quot;<br />
|- style=&quot;background:#e8e8e8;&quot;<br />
! &amp;nbsp;&amp;nbsp;''C:\uc_slimftpd_tutorial\uc_tskill\test_pages\test1.html'': check.bat&amp;nbsp;&amp;nbsp;<br />
|- style=&quot;background:#f5f5f5;&quot;<br />
| <br />
&lt;nowiki&gt;&lt;html&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;head&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;title&gt;Test2 Page&lt;/title&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/head&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;body&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;Download test:&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;a href=&quot;ftp://localhost/top_ten_music/boom_x.wav&quot;&gt;Download My music 1&lt;/a&gt;&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;a&amp;nbsp;&lt;nowiki&gt;href=&quot;ftp://localhost/top_ten_music/explosion_x.wav&quot;&gt;Download&lt;/nowiki&gt;&amp;nbsp;My&amp;nbsp;music&amp;nbsp;2&lt;nowiki&gt;&lt;/a&gt;&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;a href=&quot;ftp://localhost/blockbuster_images/users.gif&quot;&gt;Download My image 1&lt;/a&gt;&lt;br&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;a href=&quot;ftp://localhost/blockbuster_images/setup.gif&quot;&gt;Download My image 2&lt;/a&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/body&gt;&lt;/nowiki&gt;&lt;br&gt;<br />
&lt;nowiki&gt;&lt;/html&gt;&lt;/nowiki&gt;<br />
|}<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt; <br />
<br />
'''Run the page''' (double click on test2.html).<br />
<br />
# Click on either of the music links and your browser will offer you the choice to either play (open) or save the file to disk.<br />
# Click the image links these will most likely display the image however if you right click and save they are downloaded as an FTP transfer.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Email like address ==<br />
After adding an anonymous user profile it is no longer possible to easily access individual accounts using a browser (user name password login pop-up not accessible).<br />
<br />
An FTP server automatically logs into the anonymous account when its domain name is used for access.<br />
Individual accounts are accessible using their full FTP address, these look similar to an email address and have the following format:<br />
<br />
'''&lt;nowiki&gt;ftp://username@ftp_domain_name&lt;/nowiki&gt;''' e.g. &lt;nowiki&gt;http://fred@uniserver.com&lt;/nowiki&gt;<br />
<br />
FTP addresses for testing as follows:<br />
<br />
# '''&lt;nowiki&gt;ftp://localhost/&lt;/nowiki&gt;''' - Access anonymous account<br />
# '''&lt;nowiki&gt;ftp://ric@localhost/&lt;/nowiki&gt;''' - Individual account<br />
# '''&lt;nowiki&gt;ftp://dave@localhost/&lt;/nowiki&gt;''' - Individual account<br />
# '''&lt;nowiki&gt;ftp://john@localhost/&lt;/nowiki&gt;''' - Individual account<br />
<br />
Note: When using individual accounts you will notice a reduced login pop-up requires only a password.<br />
<br />
== Summary ==<br />
That concludes this tutorial; I hope you found it of some use! The tutorial's FTP server as you have seen is a fully functioning stand-alone server and can be used independently of Uniform Server.<br />
<br />
The server example using virtual hosts is important. A variant of it can be used when using SlimFTPd as a plugin.<br />
<br />
The next page covers plugins for [[SlimFTPd: Plugins | Uniform Server 3.5-Apollo and Uniform Server 3.3]].<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: Installation]]<br />
[[Category: Security]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_MySQL_problems&diff=4688Mini Servers: MySQL problems2010-11-24T01:20:12Z<p>Upazixorys: </p>
<hr />
<div>=[http://ujybyqum.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc nav mini servers}}<br />
'''MySQL problems'''<br />
<br />
While designing the MySQL mini server series I found a number of inconsistencies. Running two version 4’s and two version 5’s sometimes they worked at other times would fail even worst databases created in one would appear in a different server.<br />
<br />
I was pleased with my solution for version 5’s until the same architecture failed on version 4’s. Interestingly changing the password on a mini not only killed the mini it also took Uniform Server’s MySQL server with it. Running either as a service or program made little difference to the failures.<br />
<br />
== Server 13 - MySQL 4.1.22 Portable ==<br />
<br />
=== Problems ===<br />
The above problems started after I introduced version 4 series. It became obvious an incorrect configuration file was being picked-up by a server’s clients. Strange that since there is no configuration files on the system paths. In reality the clients were using defaults confirmed by this error message:<br />
<br />
'''No other servers running:'''<br />
&lt;pre&gt;<br />
L:\bin&gt;mysqladmin --user=root --password=root status<br />
mysqladmin: connect to server at 'localhost' failed<br />
error: 'Can't connect to MySQL server on 'localhost' (10061)'<br />
Check that mysqld is running on localhost and that the port is 3306.<br />
You can check this by doing 'telnet localhost 3306'<br />
&lt;/pre&gt;<br />
<br />
You can force a port as follows:<br />
<br />
&lt;pre&gt;<br />
L:\bin&gt;mysqladmin --port=3313 --user=root --password=root status<br />
Uptime: 816 Threads: 1 Questions: 2 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second a<br />
vg: 0.002<br />
&lt;/pre&gt;<br />
<br />
This clearly works like I said there is no configuration file on the search paths: <br />
<br />
&lt;pre&gt;<br />
Default options are read from the following files in the given order:<br />
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf<br />
&lt;/pre&gt;<br />
<br />
Interestingly it does not look in the folder from where the client is run (normally the default with most programs)<br />
<br />
You can force a client to read a default file as follows:<br />
<br />
&lt;pre&gt;<br />
--defaults-file=my.cnf (this file is contained in the folder with the execuitable folder bin)<br />
&lt;/pre&gt;<br />
<br />
Hence this will give:<br />
&lt;pre&gt;<br />
L:\bin&gt;mysqladmin --defaults-file=my.cnf --user=root --password=root status<br />
Uptime: 1628 Threads: 1 Questions: 3 Slow queries: 0 Opens: 11 Flush tables: 1 Open tables: 2 Queries per second<br />
avg: 0.002<br />
<br />
L:\bin&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
=== mysql_start.bat ===<br />
To find the configuration file MySQL (mini server 13) searches the same folders as above (C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf) so why does mini server 13 work or how does it find the correct file?<br />
<br />
Open mysql_start.bat this line forces the server to use the correct configuration file:<br />
<br />
&lt;pre&gt;<br />
start \bin\mysqld-opt.exe --defaults-file=/bin/my.cnf<br />
&lt;/pre&gt; <br />
<br />
'''''[[#top | Top]]'''''<br />
== Server 13 - MySQL 4.1.22 Service ==<br />
Running server as a service (mini server 14) identical paths are searched again the configuration file will not be found. The server needs to be forced to read the configuration file however there is a little twist to this:<br />
<br />
&lt;pre&gt;<br />
The following options may be given as the first argument:<br />
--defaults-file=# Only read default options from the given file #<br />
&lt;/pre&gt;<br />
<br />
From the above this would be a logical (Install.bat):<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin\mysqld-opt.exe --defaults-file=C:/mini_server_14/bin/my.cnf --install mini_server_14<br />
&lt;/pre&gt;<br />
<br />
However it produces this error:<br />
<br />
&lt;pre&gt;<br />
Installing MySQL Service ...<br />
The filename, directory name, or volume label syntax is incorrect.<br />
080813 20:24:45 [ERROR] C:\mini_server_14\bin\mysqld-opt.exe: unknown option '--install'<br />
The service name is invalid.<br />
More help is available by typing NET HELPMSG 2185.<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
<br />
Well that was a real pain I know the install option works on its own so perhaps it’s the order of commands. I tried the following with success:<br />
<br />
&lt;pre&gt;<br />
C:\mini_server_14\bin\mysqld-opt.exe --install mini_server_14 --defaults-file=C:/mini_server_14/bin/my.cnf<br />
&lt;/pre&gt;<br />
<br />
==== Clients ====<br />
Clients mysqladmin and mysql need to be forced to find the correct configuration file as above.<br />
<br />
However the only information specific to a client is the port, hence it's slightly quicker to type the port for example:<br />
<br />
'''mysqladmin --port=3314 --user=root --password=root status'''<br />
<br />
Alteratively you can use the slightly longer method:<br />
<br />
'''mysqladmin --defaults-file=my.cnf --user=root --password=root status'''<br />
<br />
'''''[[#top | Top]]'''''<br />
== Mini Server 12 MySQL 5.0.51b Service ==<br />
To obtain information about the server type the following at a command prompt:<br />
&lt;pre&gt;<br />
mysqld-opt --verbose --help &gt; info.txt<br />
&lt;/pre&gt;<br />
<br />
This creates a file where you can read the details at your own leisure. Of importance is this line:<br />
<br />
&lt;pre&gt;<br />
Default options are read from the following files in the given order:<br />
C:\my.ini C:\my.cnf C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\mini_server_12\my.ini C:\mini_server_12\my.cnf <br />
&lt;/pre&gt;<br />
<br />
Both clients also produce a similar result (mysqladmin --help and mysql --help) for the search path. Placing the configuration file in folder C:\mini_server_12 allows it to be picked up by the three application.<br />
<br />
Hence when typing commands there is no need to force a port or file for example this now works as expected:<br />
<br />
'''mysqladmin --user=root --password=root status'''<br />
<br />
== Conclusion ==<br />
I have included this page to explain why the differences in commands when using server versions 4 or 5. PhpMyAdmin has no problems you need to define the port used hence works as expected. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Mini Servers]]<br />
[[Category: MySQL]]<br />
[[Category: Oily Rag]]<br />
[[Category: Self Install]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_CLI:_Hidden_Process&diff=4687PHP CLI: Hidden Process2010-11-24T01:20:07Z<p>Upazixorys: </p>
<hr />
<div>=[http://usuzezyjiza.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc nav PHP CLI}}<br />
'''''PHP CLI hidden processes'''''<br />
On the previous page I covered detaching processes in certain situation that process may remain visible. For example if a process runs an infinite loop within a command window that window will remain visible.<br />
<br />
Another example is starting Apache using a command line prompt; it opens a new command window and runs in that. These command windows can be minimised however an icon remains visible on the task bar, it’s not really an issue more of an annoyance.<br />
<br />
This page covers hiding a process; this indirectly hides the task bar icon. Again being a practical tutorial I provide examples you can run allowing you to appreciate a problem first hand. Alternatively jump straight to a [[#Solution 2|'''solution''']].<br />
<br />
'''''[[#top | Top]]'''''<br />
== Initial test files ==<br />
Edit the test files used on the previous page to have the following content: (Located in folder UniServer)<br />
{|<br />
|-<br />
|'''''Run.bat''''' - No changes required<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
TITLE CLI TEST BAT<br />
COLOR B0<br />
@echo off<br />
cls<br />
echo.<br />
usr\local\php\php.exe -n test_1.php<br />
echo.<br />
:pause<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|valign=&quot;middle&quot;|<br />
This batch file runs test script test1.php<br />
<br />
'''''Nano :''''' Paths are for running on UniServer Nano<br />
<br />
'''''Mona :''''' If you want to run the script on UniServer Mona change the path as shown<br />
<br />
'''udrive\'''usr\local\php\php.exe -n test_1.php<br />
<br />
'''''Note'':''' The pause has been disabled. Batch file runs and instantly closes.<br />
|} <br />
<br />
{|<br />
|-<br />
|'''test_1.php'''<br />
|-valign=&quot;middle&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
echo &quot; \nScript test_1.php\n\n This will run a hidden process\n&quot;;<br />
usleep(2000000);<br />
$cmd = 'start usr\local\php\php.exe -n test_2.php';<br />
pclose(popen($cmd,'r')); // Run detached process <br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|valign=&quot;middle&quot;|<br />
This script runs a hidden process<br />
<br />
'''''Nano :''''' Paths are for running on UniServer Nano<br />
<br />
'''''Mona :''''' If you want to run the script on UniServer Mona change the path as shown<br />
<br />
'''udrive\'''usr\local\php\php.exe -n test_2.php<br />
|}<br />
<br />
{|<br />
|-<br />
|'''test_2.php'''<br />
|-valign=&quot;middle&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
echo &quot; \n Script test_2.php\n\n This is a hidden process!!\n&quot;;<br />
echo &quot; It delays for 10 seconds and runs script test_3.php\n&quot;;<br />
<br />
$a=0;<br />
while($a !=10){<br />
usleep(1000000); <br />
echo &quot; &quot;.$a.&quot;\n&quot;;<br />
$a=$a+1;<br />
}<br />
<br />
$cmd = &quot;start usr\local\php\php.exe -n test_3.php&quot;;<br />
pclose(popen($cmd,'r')); // Run detached process <br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
&amp;nbsp;<br />
|valign=&quot;middle&quot;|<br />
This script is a hidden process<br />
<br />
'''''Nano :''''' Paths are for running on UniServer Nano<br />
<br />
'''''Mona :''''' If you want to run the script on UniServer Mona change the path as shown<br />
<br />
'''udrive\'''usr\local\php\php.exe -n test_3.php<br />
|}<br />
<br />
Create a new file '''test_3.php''' with the following content:<br />
{|<br />
|-<br />
|'''''test_3.php'''''<br />
|-valign=&quot;top&quot;<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
$a=0;<br />
while($a !=10){<br />
usleep(1000000); <br />
echo &quot; &quot;.$a.&quot;\n&quot;;<br />
$a=$a+1;<br />
}<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt; <br />
|<br />
&amp;nbsp;<br />
|valign=&quot;middle&quot;|<br />
Purpose of this script is to provide visual feedback to show something is happening.<br />
<br />
The script uses a while loop to display digits 0 to 9<br />
<br />
A delay of 1 second is introduced before displaying a digit <br />
<br />
On completion script terminate. <br />
|} <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Test ===<br />
# Run the batch file (double click on Run.bat) closes after two seconds.<br />
# Script '''test_1.php''' runs<br />
# This runs the hidden script '''test_2.php''' <br />
# After a delay of about ten seconds runs script '''test_3.php'''<br />
# Script '''test_3.php''' counts to ten and closes<br />
<br />
OK I lied! Script '''test_2.php''' (step 3) was not hidden as expected.<br />
<br />
Real intention was to show all scripts running and to introduce a specification for the real requirement.<br />
<br />
Although a crude design specification (steps 1-5) the current implementation does not meet it.<br />
<br />
Need to resolve the failure at step 3. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Solutions ==<br />
I have included two possible solutions the first although it does not meet specification is worthy of note .<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Solution 1 ===<br />
Edit file '''test_1.php''' <br />
<br />
Add '''/b''' to start as shown below this runs a script in the background<br />
&lt;pre&gt;<br />
$cmd = 'start /b usr\local\php\php.exe -n test_2.php';<br />
&lt;/pre&gt;<br />
Run the batch file (double click on Run.bat).<br />
<br />
The second script is run in the background as expected, however any scripts run from this inherits the hidden environment hence '''test_3.php''' is hidden.<br />
<br />
For some application this may be desirable and all that is required.<br />
<br />
However it does not meet specification, I want test_2.php to be hidden and test_3.php to be displayed.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Solution 2 ===<br />
Edit file test_1.php<br />
There are two changes, remove the '''/b''' and replace '''php.exe''' with '''php-win.exe''' this runs a script in the background <br />
&lt;pre&gt;<br />
&lt;?php<br />
echo &quot; \n Script test_1.php\n\n This will run a hidden process\n&quot;;<br />
usleep(2000000);<br />
$cmd = &quot;start usr\local\php\php-win.exe -n test_2.php&quot;;<br />
pclose(popen($cmd,'r')); // Start a new forked process close file pointer<br />
exit(0); // Script ran OK<br />
?&gt;<br />
&lt;/pre&gt; <br />
Run the batch file (double click on Run.bat). The second script is run in the background, after a delay (about ten seconds) '''test_3.php''' is displayed as expected.<br />
<br />
'''php-win.exe''' Is identical to '''php.exe''' With a few exceptions it runs hidden in the background and disables standard IO meaning it does not attempt to display anything or receive keyboard input. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== CLI Programs ==<br />
Two client programs are provided by PHP they differ only in their mode of operation, either foreground or background.<br />
* '''php.exe''' - Starts a command window and runs in the foreground<br />
* '''php-win.exe''' - Does not start a command window, runs in the background<br />
<br />
Apart from the mode differences they are identical, hence you can easily switch between the two for testing code.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
I have shown how easy it is to run hidden process either use '''start /b''' or '''php-win.exe''' which to choose is application dependent.<br />
<br />
Another alternative is to use Uniform Server's utility '''uniserv.exe''' this was specifically designed to run Apache in the background hidden. It can be found in the following folder:<br />
<br />
'''''Nano'':''' UniServer\main\program\'''uniserv.exe'''<br />
<br />
'''''Mona'':''' UniServer\udrive\home\admin\program\'''uniserv.exe'''<br />
<br />
<br />
However hidden processes are of little use when it comes to user input.<br />
<br />
Generally speaking CLI scripts are used for system maintenance with no user interaction.<br />
<br />
That said there are occasions when some user interaction is required, this is covered on the [[PHP CLI: User Input | next page]].<br />
<br />
Although a simple interface (no GUI) is used it is more than adequate for most purposes.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || '''MPG''' (Ric)<br />
|}<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=FileZilla_Server3:_Batch_Files&diff=4686FileZilla Server3: Batch Files2010-11-24T01:19:55Z<p>Upazixorys: </p>
<hr />
<div>=[http://ejahibuko.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=<br />
{{Uc nav FileZilla Server3}}<br />
'''Batch Files'''<br />
<br />
If you intend to run Uniform Server and FileZilla together independent control can be inconvenient. This page looks at combining server control to run both servers at the same time.<br />
<br />
Folder UniServer contains three batch files fz_admin.bat, fz_start.bat and fz_stop.bat<br />
These can be deleted however it’s probably worth keeping '''fz_admin.bat''' this will allow FileZilla admin to be restarted if accidentally closed.<br />
<br />
Uniform Server can be controlled from batch files contained in folder '''alternative_control''' these files are easily modified to control both servers.<br />
<br />
Remainder of this page looks at modifications required. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Portable – Standard program ==<br />
Portable mode requires FileZilla’s configuration file to have absolute paths rewritten hence fzp_start.bat will be used.<br />
<br />
Edit file '''Start_Server.bat'''<br />
<br />
Add the last two lines as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\start_servers.php<br />
<br />
start ..\filezilla_server\portable\fzp_start.bat<br />
..\filezilla_server\filezilla_ftpd\zilla_admin.bat <br />
&lt;/pre&gt;<br />
Edit file '''Stop_Server.bat'''<br />
<br />
Add the last line as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\stop_servers.php<br />
start ..\filezilla_server\filezilla_ftpd\zilla_stop.bat<br />
&lt;/pre&gt;<br />
<br />
The above two batch files start and stop both servers these are run as a standard program.<br />
<br />
Note: You need to manually close FileZilla Admin<br />
<br />
=== Move batch files ===<br />
It may be more confinement to copy Start_Server.bat and Stop_Server.bat to folder UniServer this keeps all server control in a single folder.<br />
<br />
Having copied files to folder UniServer edit each file to have all paths reflect new location as follows:<br />
<br />
Edit file '''Start_Server.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\start_servers.php<br />
<br />
start filezilla_server\portable\fzp_start.bat<br />
filezilla_server\filezilla_ftpd\zilla_admin.bat <br />
&lt;/pre&gt;<br />
Edit file '''Stop_Server.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\stop_servers.php<br />
start filezilla_server\filezilla_ftpd\zilla_stop.bat<br />
&lt;/pre&gt;<br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Static – Standard program ==<br />
Static operation does not rewrite paths in FileZilla’s configuration file. Configuration is identical to the above with one exception file fzp_start.bat is replaced with zilla_start.bat<br />
<br />
Edit file '''Start_Server.bat'''<br />
<br />
Add the last two lines as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\start_servers.php<br />
<br />
start ..\filezilla_server\filezilla_ftpd\zilla_start.bat<br />
..\filezilla_server\filezilla_ftpd\zilla_admin.bat <br />
&lt;/pre&gt;<br />
Edit file '''Stop_Server.bat'''<br />
<br />
Add the last line as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\stop_servers.php<br />
start ..\filezilla_server\filezilla_ftpd\zilla_stop.bat<br />
&lt;/pre&gt;<br />
<br />
The above two batch files start and stop both servers these are run as a standard program.<br />
<br />
Note: You need to manually close FileZilla Admin<br />
<br />
=== Move batch files ===<br />
It may be more confinement to copy Start_Server.bat and Stop_Server.bat to folder UniServer this keeps all server control in a single folder.<br />
<br />
Having copied files to folder UniServer edit each file to have all paths reflect new location as follows:<br />
<br />
Edit file '''Start_Server.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\start_servers.php<br />
<br />
start filezilla_server\portable\fzp_start.bat<br />
filezilla_server\filezilla_ftpd\zilla_admin.bat <br />
&lt;/pre&gt;<br />
Edit file '''Stop_Server.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\stop_servers.php<br />
start filezilla_server\filezilla_ftpd\zilla_stop.bat<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Static – Service ==<br />
Running, as a service is similar to the above only difference is service batch files are run. Configuration as follows:<br />
<br />
Edit file '''Service_Install_Run.bat'''<br />
<br />
Add the last two lines as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\service_install_run.php<br />
<br />
..\filezilla_server\filezilla_ftpd\zilla_service_start.bat<br />
..\filezilla_server\filezilla_ftpd\zilla_admin.bat<br />
&lt;/pre&gt;<br />
Edit file '''Service_Stop_Uninstall.bat'''<br />
<br />
Add the last line as shown below:<br />
&lt;pre&gt;<br />
..\usr\local\php\php.exe -n ..\unicon\main\service_stop_uninstall.php<br />
<br />
..\filezilla_server\filezilla_ftpd\zilla_service_stop.bat<br />
&lt;/pre&gt;<br />
<br />
The above two batch files install/start and stop/uninstalls both server services.<br />
<br />
Note: You need to manually close FileZilla Admin<br />
<br />
=== Move batch files ===<br />
It may be more confinement to copy Service_Install_Run.bat and Service_Stop_Uninstall.bat to folder UniServer this keeps all server control in a single folder.<br />
<br />
Having copied files to folder UniServer edit each file to have all paths reflect new location as follows:<br />
<br />
Edit file '''Service_Install_Run.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\service_install_run.php<br />
<br />
filezilla_server\filezilla_ftpd\zilla_service_start.bat<br />
filezilla_server\filezilla_ftpd\zilla_admin.bat<br />
&lt;/pre&gt;<br />
Edit file '''Service_Stop_Uninstall.bat'''<br />
&lt;pre&gt;<br />
usr\local\php\php.exe -n unicon\main\service_stop_uninstall.php<br />
<br />
filezilla_server\filezilla_ftpd\zilla_service_stop.bat<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
Running both servers requires the addition of one or two lines to the control batch files.<br />
<br />
A similar approach can be applied to UniTray’s configuration file see [[FileZilla Server3: UniTray | '''next page''']] for details.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Setup]]<br />
[[Category: How To]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=MongoDB_Tutorial_2:_Alternative_control&diff=4683MongoDB Tutorial 2: Alternative control2010-11-24T01:19:26Z<p>Upazixorys: </p>
<hr />
<div>=[http://ezapazuhem.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=<br />
{{Nav MongoDB Tutorial 2}}<br />
'''''MongoDB'''''<br />
== Introduction ==<br />
Alternative control is a spin-off from testing the main application. These batch/scripts are worth keeping because users may prefer them.<br />
<br />
== Requirements ==<br />
Scripts for alternative control are contained in folder z_mongo\UniServer\usr\local\mongo\alt_control\'''''alt_control''''' these scripts reflect functionality of our main program.<br />
<br />
We require scripts that perform the following tasks:<br />
* Start MongoDB<br />
* Stop MongoDB<br />
* Run Mongo client<br />
* Open a command prompt<br />
<br />
Four batch files and corresponding PHP scripts are required. These PHP scripts obtain their resources (paths function) from a shared include file located in folder z_mongo\UniServer\unicon\'''tray_menu_2'''.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Main include file ==<br />
During the introduction tutorial we created a file '''''mongo_db_inc.php''''' containing functions required for various application. A sub-set from this file is required for this application. <br />
<br />
In folder z_mongo\UniServer\unicon\'''tray_menu_2'''.<br />
create a new file named '''''mongo_db_inc.php''''' from file z_mongo\temp\'''''z_temp\mongo_db_inc.php''''' copy the following lines.<br />
&lt;pre&gt;<br />
$path_array = explode(&quot;\\usr&quot;,getcwd()); // Split at folder usr<br />
$mongo_base = $path_array[0]; // find drive letter and any sub-folders <br />
$mongo_base_f = preg_replace('/\\\/','/', $mongo_base); // Replace \ with /<br />
<br />
//=== FOLDERS ===<br />
define(&quot;MONGO_BIN&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin&quot;); // Binaries for MongoDB<br />
<br />
//=== FILES ===<br />
define(&quot;CONFIG_NO_AUTH_F&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/config_no_auth.ini&quot;); <br />
define(&quot;CONFIG_AUTH_F&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/config_auth.ini&quot;); <br />
define(&quot;NAME_PWD_F&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/mongo_name_password&quot;); <br />
define(&quot;UNISERV_EXE&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/uniserv.exe&quot;); // Utility <br />
define(&quot;UNISERV_EXE_B&quot;, $mongo_base.'\usr\local\mongo_tutorial\bin\uniserv.exe'); // Utility <br />
define(&quot;MON_PSKILL_EXE&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/pskill.exe&quot;); // Utility <br />
define(&quot;CMD_DUMMY_TXT&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/cmd_dummy.txt&quot;); // Temp command fie<br />
&lt;/pre&gt;<br />
It should be obvious all paths are incorrect and need updating added to this are items relating to authentication these need deleting.<br />
<br />
First delete authentication related to give:<br />
&lt;pre&gt;<br />
$path_array = explode(&quot;\\usr&quot;,getcwd()); // Split at folder usr<br />
$mongo_base = $path_array[0]; // find drive letter and any sub-folders <br />
$mongo_base_f = preg_replace('/\\\/','/', $mongo_base); // Replace \ with /<br />
<br />
//=== FOLDERS ===<br />
define(&quot;MONGO_BIN&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin&quot;); // Binaries for MongoDB<br />
<br />
//=== FILES ===<br />
define(&quot;CONFIG_NO_AUTH_F&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/config_no_auth.ini&quot;); <br />
define(&quot;UNISERV_EXE&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/uniserv.exe&quot;); // Utility <br />
define(&quot;UNISERV_EXE_B&quot;, $mongo_base.'\usr\local\mongo_tutorial\bin\uniserv.exe'); // Utility <br />
define(&quot;MON_PSKILL_EXE&quot;, &quot;$mongo_base_f/usr/local/mongo_tutorial/bin/pskill.exe&quot;); // Utility <br />
&lt;/pre&gt;<br />
First line splits current working directory at folder '''''usr''''' this requires changing. Choose a folder that is common to folders '''usr''' and '''unicon''', in this case use folder '''''UniServer'''''<br />
<br />
With this split we have a reference '''$mongo_base''' that is a path up to folder UniSerer hence this folder must be added to the paths being reconstructed.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Paths ===<br />
After making the changes section looks like this:<br />
&lt;pre&gt;<br />
$path_array = explode(&quot;\\UniServer&quot;,getcwd()); // Split at folder usr<br />
$mongo_base = $path_array[0]; // find drive letter and any sub-folders <br />
$mongo_base_f = preg_replace('/\\\/','/', $mongo_base); // Replace \ with /<br />
<br />
//=== FOLDERS ===<br />
define(&quot;MONGO_BIN&quot;, &quot;$mongo_base_f/UniServer/usr/local/mongo/bin&quot;); // Binaries for MongoDB<br />
<br />
//=== FILES ===<br />
define(&quot;CONFIG_NO_AUTH_F&quot;, MONGO_BIN.&quot;/config_no_auth.ini&quot;); <br />
define(&quot;UNISERV_EXE&quot;, MONGO_BIN.&quot;/uniserv.exe&quot;); // Utility <br />
define(&quot;UNISERV_EXE_B&quot;, $mongo_base.'\UniServer\usr\local\mongo\bin\uniserv.exe'); // Utility <br />
define(&quot;MON_PSKILL_EXE&quot;, MONGO_BIN.&quot;/pskill.exe&quot;); // Utility <br />
<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Command Prompt ==<br />
From z_mongo\temp\mongo_db_inc.php copy function '''''open_cmd_window()''''' to file z_mongo\UniServer\unicon\tray_menu_2\mongo_db_inc.php <br />
<br />
In folder '''alt_control''' create the following two files with content as shown<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Run_cmd.bat ===<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
TITLE UNIFORM SERVER - Run Command Prompt<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
cd ..\..\php<br />
php.exe -c mongo_cli.ini ..\mongo\alt_control\run_cmd.php<br />
<br />
pause<br />
EXIT<br />
&lt;/pre&gt;<br />
|<br />
'''''Comments'':'''<br />
<br />
* '''..\..\php''' Changes working folder. From current folder ..\..\ move up two folder levels and down into folder php<br />
* '''php.exe''' Run PHP <br />
* '''-c mongo_cli.ini''' Use this configuration file<br />
* '''..\mongo\alt_control\run_cmd.php''' Move up one folder level and down into folder alt_control and run script run_cmd.php <br />
<br />
'''''Note'':'''<br />
<br />
After testing you can comment out the pause. <br />
<br />
|}<br />
<br />
=== run_cmd.php ===<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
&lt;?php<br />
<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once &quot;../../../../unicon/tray_menu_2/mongo_db_inc.php&quot;;<br />
<br />
open_cmd_window(); // Run command prompt function<br />
<br />
?&gt;<br />
&lt;/pre&gt;<br />
|<br />
* Change folder to alt_control<br />
* Include file. Move up four folder levels down into folder tray_menu_2 and include file mongo_db_inc.php<br />
* Run function open_cmd_window()<br />
|}<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Test ===<br />
* Run batch file. Double click on Run_cmd.bat<br />
* A command window opens displaying the content of folder bin<br />
<br />
Above confirms we have a working structure and can add further components. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Support Functions ==<br />
A user can change server’s working port in the configuration file.<br />
<br />
We have a function that determines this<br />
<br />
From z_mongo\temp\mongo_db_inc.php copy function '''''get_mongo_port_no_auth()''''' to file z_mongo\UniServer\unicon\tray_menu_2\mongo_db_inc.php<br />
<br />
We will require several functions hence copy the following:<br />
* set_mongo_port_no_auth($new_port)<br />
* start_mongo_no_auth()<br />
* stop_mongo_no_auth()<br />
* client_no_auth() <br />
* mongodb_running()<br />
* mongo_client_running()<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Additional Scripts ==<br />
Create the following scripts with content as shown<br />
=== Run_start_mongo.bat ===<br />
&lt;pre&gt;<br />
<br />
TITLE UNIFORM SERVER - Run Start MongoDB<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
cd ..\..\php<br />
php.exe -c mongo_cli.ini ..\mongo\alt_control\run_start_mongo.php<br />
<br />
pause<br />
EXIT<br />
&lt;/pre&gt;<br />
=== run_start_mongo.php ===<br />
&lt;pre&gt;<br />
&lt;?php<br />
<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once &quot;../../../../unicon/tray_menu_2/mongo_db_inc.php&quot;;<br />
<br />
start_mongo_no_auth(); // Run start mongo function<br />
?&gt;<br />
&lt;/pre&gt;<br />
=== Run_stop_mongo.bat ===<br />
&lt;pre&gt;<br />
<br />
TITLE UNIFORM SERVER - Run Stop MongoDB<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
cd ..\..\php<br />
php.exe -c mongo_cli.ini ..\mongo\alt_control\run_stop_mongo.php<br />
<br />
pause<br />
EXIT<br />
&lt;/pre&gt;<br />
=== run_stop_mongo.php ===<br />
&lt;pre&gt;<br />
&lt;?php<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once &quot;../../../../unicon/tray_menu_2/mongo_db_inc.php&quot;;<br />
<br />
stop_mongo_no_auth() ; // Run command prompt function<br />
?&gt;<br />
&lt;/pre&gt;<br />
<br />
=== Run_client.bat ===<br />
&lt;pre&gt;<br />
TITLE UNIFORM SERVER - Run Mongo Client<br />
COLOR B0<br />
@echo off<br />
cls<br />
<br />
cd ..\..\php<br />
php.exe -c mongo_cli.ini ..\mongo\alt_control\run_client.php<br />
<br />
pause<br />
EXIT<br />
&lt;/pre&gt;<br />
=== run_client.php ===<br />
&lt;pre&gt;<br />
&lt;?php<br />
chdir(dirname(__FILE__)); // Change wd to this files location<br />
include_once &quot;../../../../unicon/tray_menu_2/mongo_db_inc.php&quot;;<br />
<br />
client_no_auth() ; // Run command prompt function<br />
?&gt;<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Test ===<br />
* Start server double click on Run_start_mongo.bat wait a short time<br />
* Run client double click on Run_client.bat check connection is made. Type exit<br />
* Stop server double click on Run_stop_mongo.bat wait a short time<br />
* Run client double click on Run_client.bat check connection fails.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
I was asked why do you need the PHP CLI scripts? They were included only to test each associated function.<br />
<br />
Thinking about that question the user had not missed the point what they wanted were pure batch files no PHP.<br />
<br />
I have addressed the above on the next page [[MongoDB Tutorial 2: Alternative control 2 | '''Alternative control 2''']]<br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 6-Carbo]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=AWStats_for_5-Nano&diff=4680AWStats for 5-Nano2010-11-24T01:19:04Z<p>Upazixorys: </p>
<hr />
<div>=[http://usuzezyjiza.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
&lt;span id=&quot;top&quot;&gt;&lt;/span&gt;<br />
{| cellpadding=&quot;2&quot;<br />
|<br />
__TOC__<br />
||<br />
|}<br />
'''''UniServer AWStats plugin for Uniform Server 5-Nano series'''''<br />
<br />
This plugin installs [http://awstats.sourceforge.net/ AWStats] on Uniform Server Nano. AWStats is a free powerful and fully featured tool that generates advanced web, streaming, ftp or mail server statistics, graphically.<br />
<br />
Due to UniServer's architecture change there are two versions of this plugin with and without Perl. Both plugins use AWStats (9.8) also installs password protection for online viewing.<br />
<br />
This page describes how to install the AWStats plugin and provides information for viewing stats on-line. <br />
<br />
== Version choice ==<br />
There are two versions of AWAtats plugin:<br />
<br />
=== V5.0_AWStats_1.0 ===<br />
This version includes V5.0_mini_perl (ActivePerl 5.10.0.1005) and is intended for users who just want to display server statistics.<br />
<br />
It avoids the need to download and install a Perl plugin however it does restrict you to using ActivePerl version 5.10.0.1005.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== V5.0_AWStats_2.0 ===<br />
This version does not include Perl hence increases flexibility by allowing you to choose a specific version of Perl.<br />
<br />
Currently there are two versions of the Perl plugin split into mini and full:<br />
<br />
* V5.0_mini_perl ActivePerl 5.10.0.'''1005'''<br />
* V5.0_full_perl ActivePerl 5.10.0.'''1005'''<br />
<br />
* V5.1_mini_perl ActivePerl 5.10.0.'''1006'''<br />
* V5.1_full_perl ActivePerl 5.10.0.'''1006'''<br />
<br />
Before proceeding to AWStats installation download and install one of the above Perl versions see [[5.0-Nano: Perl | '''Perl page''']] for details.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Download and Install ==<br />
There are two installation options as follows replace # with the version you are installing:<br />
<br />
'''''Options 1'':'''<br />
# Download file '''V5.0_AWStats_#.0.exe''' from [http://sourceforge.net/projects/miniserver/files/ Sourceforge]<br />
# Save it to folder '''UniServer'''.<br />
# To extract files, double click on file V5.0_AWStats_#.0.exe, no need to change the path.<br />
# If you wish to save space delete V5.0_AWStats_#.0.exe<br />
<br />
'''''Options 2'':'''<br />
# Download file '''V5.0_AWStats_#.0.zip''' from [http://sourceforge.net/projects/miniserver/files/ Sourceforge] <br />
# Save to any folder (e.g. '''''temp1''''')<br />
# Extract files, navigate to folder V5.0_AWStats_#.0<br />
# Copy the entire contents (read_me.txt, usr, www ... etc) to Uniform Server's folder UniServer allow overwrite. <br />
# If you wish to save space delete '''''temp1'''''<br />
<br />
'''''Folders and files'''''<br />
<br />
The following are added to Uniform Server<br />
<br />
* AWStats is installed in folder UniServer\cgi-bin\'''awstats'''<br />
* Password file '''.htpasswd''' can be found in folder UniServer\htpasswd\'''awstats'''<br />
* Perl '''bin''' and '''lib''' are added to folder UniServer\usr (If using '''V5.0_AWStats_1.0''') <br />
* Folder UniServer\www is updated with folders '''css''', '''icon''' and '''js''' containing support files for AWStats. <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Common ===<br />
Whichever installation option you choose all Perl scripts must have their shebang updated to match current server location.<br />
<br />
'''''Update Shebang'':'''<br />
* Left mouse click UniTray &gt; Mouse over '''Advanced''' and select '''Perl Shebang Update cgi-bin'''<br />
* The above requires performing once (before starting servers) thereafter shebangs are automatically on relocating the servers. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Testing ==<br />
Testing is straight forward:<br />
* Start the servers<br />
* Type the following into a browser '''&lt;nowiki&gt;http://localhost/cgi-bin/awstats/awstats.pl&lt;/nowiki&gt;'''<br />
<br />
'''''Note'':'''<br />
<br />
If you have moved the servers remember to include the port number for example:<br />
<br />
'''&lt;nowiki&gt;http://localhost:82/cgi-bin/awstats/awstats.pl&lt;/nowiki&gt;'''<br />
<br />
Use UniTray '''Server Status''' to find the Apache port number. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Security ==<br />
The plugin defaults to restricting access to '''localhost'''. This can be overridden to put AWStats online allowing you to view your server stats over the Internets. This may be a security risk hence you heve the option to password protect this information.<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Default Local access only ===<br />
Local access is implemented using a '''.htaccess''' file located in folder UniServer\cgi-bin\'''awstats'''<br />
<br />
The file contains the following lines:<br />
&lt;pre&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/pre&gt;<br />
The line '''Allow from 127.0.0.1''' restricts access to localhost only. This prevents every one on the Internet viewing your stats information. You can however view the statistics page locally.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== View Stats on-line ===<br />
To view your server statistics online password protect folder '''awstats'''.<br />
<br />
==== Enable Password protection ====<br />
The above .htaccess file contains additional lines allowing you to password protect folder awstats.<br />
<br />
To put your stats online edit file UniServer\cgi-bin\awstats\'''.htaccess''' as follows:<br />
<br />
Comment (add hash) these lines as shown: (Allows anyone access)<br />
&lt;pre&gt;<br />
#Order Deny,Allow<br />
#Deny from all<br />
#Allow from 127.0.0.1<br />
&lt;/pre&gt; <br />
Uncomment (remove hash) these lines as shown: (Enables name/password protection) <br />
&lt;pre&gt;<br />
AuthName &quot;Uniform Server - Server Access&quot;<br />
AuthType Basic<br />
AuthUserFile /htpasswd/awstats/.htpasswd<br />
Require valid-user<br />
&lt;/pre&gt;<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
==== Set new name and password ====<br />
The default name and password is '''root''' they are compromised hence need changing as follows:<br />
<br />
Edit file UniServer\htpasswd\awstats\'''.htpasswd'''<br />
<br />
'''''Default'':''' Contains the following:<br />
&lt;pre&gt;<br />
root:root<br />
&lt;/pre&gt;<br />
'''''Change'':''' Choose a suitable name and password and change the file as follows:<br />
&lt;pre&gt;<br />
new_name:new_password<br />
&lt;/pre&gt;<br />
<br />
==== To view on-line ====<br />
Type the following into a browser: '''&lt;nowiki&gt;http://your_domain_name/cgi-bin/awstats/awstats.pl&lt;/nowiki&gt; ''' <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Conclusion ==<br />
Installing AWStats with this plugin is easy, to view your stats on-line requires minimum of changes.<br />
<br />
The stats provided may not meet your requirements however AWStats and Apache are customisable for details check out AWStats [http://awstats.sourceforge.net/ web site].<br />
<br />
Related information [[Installing AWStats | How to install AWStats on Uniform Server 3.5-Apollo]]<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Uniform Server 5.0-Nano]]<br />
[[Category: Plugins]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=MongoDB_Tutorial_2:_Introduction&diff=4679MongoDB Tutorial 2: Introduction2010-11-24T01:19:03Z<p>Upazixorys: </p>
<hr />
<div>=[http://ihyveqo.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Nav MongoDB Tutorial 2}}<br />
'''''MongoDB'''''<br />
== Introduction ==<br />
[[MongoDB Tutorial 1: Introduction | Previous tutorial]] covered an independent implementation of MongoDB advantage of this it can be run alongside any version of Uniform Server or any WAMP stack.<br />
<br />
You need to download a separate driver to access MongoDB server using PHP. If you prefer a browser interface to control the server for example phpMoAdmin requires another download.<br />
<br />
This tutorial looks at integrating the above into Uniform Server 6-Carbo. Advantages of this all components installed using a plugin, reduction in footprint. In addition access to Uniform Server’s control allowing both MongoDB and Apache to be run from a common interface.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Downloads ==<br />
We require a working server to this we will add components from the tutorial plugin. <br />
<br />
=== Uniform Server ===<br />
Download Uniform Server 6-Carbo and extract to any folder for example '''''z_mongo'''''<br />
<br />
For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]<br />
<br />
=== Tutorial Plugin Download ===<br />
Download the tutorial plugin and extract to any folder for example '''''mongo_temp'''''<br />
<br />
For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Overview ==<br />
A plugin contains all components we wish to overlay on Uniform Server. Create a new folder named '''''mongodb_b''''' this will contain a folder structure that maps that of Uniform Server. It contains only plugin components these are copied from our reference-working server.<br />
<br />
First we create a reference-server by coping appreciate components from the tutorial plugin. This contains a complete set of components (independent, plugin, authentication, no authentication etc) only a sub-set is required for our new plugin.<br />
<br />
Reference-server in a test bed once we have tested and moved the finished componets over to mongodb_b it can be deleted.<br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
== Basic structure ==<br />
First we need to build a basic test structure. Appropriate components are copied from mongo_temp to z_mongo and reflected in mongodb_b<br />
<br />
* Copy folder: mongo_temp\UniServer\home\admin\www\tutorial_phpMoAdmin<br />
* To: z_mongo\UniServer\home\admin\www\tutorial_phpMoAdmin<br />
* Rename copied folder to '''''phpMoAdmin'''''<br />
*---<br />
* Copy files<br />
** mongo_temp\UniServer\usr\local\mongo_tutorial\WinBinder_1\a_test\mongo_tutorial2.phpw<br />
**mongo_temp\UniServer\usr\local\mongo_tutorial\WinBinder_1\a_test\mongo_tutorial2.bat<br />
* To folder: z_mongo\UniServer\unicon\tray_menu_2<br />
*---<br />
* Copy folder: mongo_temp\UniServer\usr\local\php<br />
* To folder: (allow overwrite) z_mongo\UniServer\usr\local<br />
*---<br />
* In folder z_mongo\UniServer\usr\local create a new folder named '''''mongo'''''<br />
* Copy folder: mongo_temp\UniServer\usr\local\mongo_tutorial\bin<br />
* To folder: z_mongo\UniServer\usr\local\mongo<br />
*---<br />
* Copy folder: mongo_temp\UniServer\usr\local\mongo_tutorial\data<br />
* To folder: z_mongo\UniServer\usr\local\mongo<br />
*---<br />
* Create a new folder z_mongo\temp<br />
* Copy to it file: mongo_temp\UniServer\usr\local\mongo_tutorial\Cheat_folder\mongo_db_inc.php<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Rename and clean-up ===<br />
Some of folders copied contain files that are not required these can be deleted. While we ar at it some files are better renamed.<br />
* Rename: z_mongo\UniServer\unicon\tray_menu_2\mongo_tutorial2.bat to Run_mongo_db.bat<br />
* Rename: z_mongo\UniServer\unicon\tray_menu_2\mongo_tutorial2.phpw to mongo_db.php<br />
<br />
* Delete: z_mongo\UniServer\usr\local\mongo\bin\config_auth.ini<br />
* Delete: z_mongo\UniServer\usr\local\mongo\bin\mongo_name_password<br />
<br />
* Rename: z_mongo\UniServer\usr\local\php\mongo_tutorial_cli.ini to mongo_cli.ini<br />
<br />
'''''[[#top | Top]]'''''<br />
== Test ==<br />
Lets run a quick test to see if every thing was copied correctely<br />
<br />
* Run file: z_mongo\UniServer\unicon\tray_menu_2\Run_mongo_db.bat<br />
Produces the followinf error:<br />
&lt;pre&gt;<br />
Warning: dl(): Unable to load dynamic library 'C:\php5\php_winbinder.dll' - The specified module could not be found.<br />
in C:\z_mongo\UniServer\unicon\tray_menu_2\winbinder\winbinder.php on line 15<br />
<br />
Fatal error: WinBinder extension could not be loaded.<br />
in C:\z_mongo\UniServer\unicon\tray_menu_2\winbinder\winbinder.php on line 16<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
First line is interesting 'C:\php5\php_winbinder.dll' PHP has tried all paths and finally looked in the default location. <br />
<br />
The error message is misleading does not point to a true cause if you do have a path C:\php5 chances are you installed PHP manually. <br />
<br />
Errors at lines 15 and 16 prove windinder paths are correctly picked up.<br />
<br />
Reason for the error WinBinder was not enabled in the configuration file<br />
<br />
Edit file z_mongo\UniServer\usr\local\php\'''mongo_cli.ini''' un-comment the winbinder extension as shown:<br />
&lt;pre&gt;<br />
[PHP]<br />
extension=php_winbinder.dll<br />
<br />
extension_dir = &quot;./extensions&quot;<br />
error_reporting = E_ALL <br />
date.timezone = &quot;Europe/London&quot;<br />
extension=php_mongo.dll<br />
&lt;/pre&gt;<br />
Rerun the batch file and a window with a few buttons will greet you.<br />
<br />
This confirms WinBinder is working correctly. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
The above gives us a working environment.<br />
<br />
We are not interested in the windows thingy until a working alternative control is in place. This is needed to test and debug the windows application.<br />
<br />
Next page covers [[MongoDB Tutorial 2: Alternative control | '''alternative control.''']] <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 6-Carbo]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=Admin_Panel_2:_PHP_Configuration&diff=4677Admin Panel 2: PHP Configuration2010-11-24T01:18:57Z<p>Upazixorys: </p>
<hr />
<div>=[http://ekipebu.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=<br />
{{Uc_nav_apanel2}}<br />
'''PHP Configuration'''<br />
<br />
This page allows you to set PHP default settings, requires a server '''re-start''' for the setting to take place.<br />
<br />
You can change the following PHP default values:<br />
<br />
{|cellpadding=&quot;4&quot;<br />
|-<br />
!style=&quot;background:#cccccc&quot;|Name <br />
!style=&quot;background:#cccccc&quot;|Default value<br />
!&amp;nbsp;<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Safe Mode:<br />
|off<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Show PHP In Server Signature:<br />
|on<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Register Globals:<br />
|on<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Maximum Script Execute Time (s.):<br />
|300<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Maximum Memory Amount (MB):<br />
|32M<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Print Errors:<br />
|on<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Maximum Post Size:<br />
|10M<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|-style=&quot;background:#e1e1e1&quot;<br />
|Maximum Upload Size:<br />
|10M<br />
|style=&quot;background:#f5f5f5&quot;|'''?'''<br />
|}<br />
<br />
'''''Note'':''' The question mark (link) to the right of each text field takes you to the appropriate section of the online documentation for that setting.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Safe Mode ==<br />
'''Default OFF'''<br />
<br />
If you are sharing your server with others and allowing them to run their own PHP scripts, it is probably worth considering switching safe mode ON. At best it is a compromise however the loss of some facilities may anger your them.<br />
<br />
If you are running third party scripts and safe mode on, you may find some of these scripts will not run. The default is OFF, it’s a good idea to leave it that way, but if you think you need the extra security it provides switch it on.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Show PHP In Server Signature ==<br />
'''Default is ON'''<br />
<br />
PHP will add its signature to the Web server header. This can be used to determine that you are using PHP on your server.<br />
<br />
You can turn it off to hide the signature, however you must take further steps to hide the fact you are using PHP. Personally I think this is not worth the effort it just depends how paranoid you are.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Register Globals ==<br />
'''Default is ON'''<br />
<br />
This is a two edged sword, if you switch it off as you should the chances are some third party code may not run. It is this legacy code that prevents register globals being depreciated.<br />
<br />
If you are writing new code use '''Super Globals''' and switch Register '''Globals OFF'''. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Maximum Script Execute Time (s) ==<br />
'''Default 300s'''<br />
<br />
This is the maximum time that a script can run, 300s in process time is a millennium in computer time. However do not be fooled, at some point you may have to increase this value depends what your scripts do. Database intensive scripts can easily exceed this maximum. For the average script it should be OK.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Maximum Memory Amount (MB) ==<br />
'''Default 32M'''<br />
<br />
Looks a reasonable value but remember arrays tend to be large, add a few open files and dump a database to an array and may be that figure is on the small size. Do not be surprised if you need to increase this value at some point. On the other hand may be this is too large for your needs, it's your choice remember if you break it just change it to a value that works for you.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Print Errors ==<br />
'''Default ON'''<br />
<br />
The default php.ini setting is to show (displayed in your browser) all script errors, except for notices and coding standards warnings. You can if you wish increase this level of reporting but the defaults should be more that adequate for development. (Too may warnings just confuse)?<br />
<br />
For p'''roduction servers''' turn '''Print Errors to OFF''', well you don’t want to show the whole world what a bad programmer you are. More importantly it is a '''security risk''' a lot of information can be gained about your system from these error messages.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Maximum Post Size ==<br />
'''Default 10M'''<br />
<br />
Maximum size of POST data, that PHP will accept. It looks large and it is; just depends on your application.<br />
<br />
== Maximum Upload Size ==<br />
'''Default 10M'''<br />
<br />
Maximum allowed size for uploaded files. Again it is a large value like I said above depends on your application. Even a zipped file with a few images can exceed this.<br />
<br />
Bottom line it’s your server you can do whatever you like with it, the above are only suggestions with comments to give a feel for what to change. <br />
<br />
'''''[[#top | Top]]'''''<br />
----<br />
<br />
{| <br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: New Users]]<br />
[[Category: Support]]<br />
[[Category: About]]<br />
[[Category: Facts]]<br />
[[Category: Troubleshooting]]</div>Upazixoryshttps://wiki.uniformserver.com/index.php?title=PHP_WinBinder_2:_Resource&diff=4675PHP WinBinder 2: Resource2010-11-24T01:18:38Z<p>Upazixorys: </p>
<hr />
<div>=[http://awuhodynaro.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=<br />
{{Nav PHP WinBinder 2}}<br />
'''''WinBinder Part 2 PHC-Win Resources'''''<br />
<br />
On the previous page I mentioned image duplication. We included individual images with our distribution package, however PHC-Win adds these to the final exe file.<br />
<br />
Without making code changes, these image resources are not directly accessible by WinBinder, hence the reason for adding them to our distribution package.<br />
<br />
This page describes code changes required to use images contained within the .exe file, thus eliminating the need for separately including them with the distribution package.<br />
<br />
== Embeder overview ==<br />
The embeder creates an executable file where additional files may be added.<br />
<br />
These files are added to an array named PHP. Array keys are md5 encoded. A resource file is accessible via its key.<br />
<br />
Running this executable creates a unique constant named '''''EMBEDED'''''.<br />
<br />
It’s worth looking at the mechanics of this process.<br />
{|<br />
|-valign=&quot;top&quot;<br />
|<br />
'''Setup'''<br />
* Copy image '''red.bmp''' from folder C:\us_wb\'''my_app''' and save it to folder C:\us_wb\'''phc'''<br />
*Create a new batch file named '''test.bat''' in folder C:\us_wb\'''phc''' with the content shown on the right.<br />
|<br />
'''test.bat'''<br />
&lt;pre&gt;<br />
embeder2.exe new test2<br />
embeder2.exe add test2 red.bmp ./<br />
embeder2.exe list test2<br />
pause<br />
&lt;/pre&gt;<br />
|-valign=&quot;top&quot;<br />
|<br />
'''Batch file'''<br />
<br />
* First line runs the embeder program. It creates a new executable '''test2.exe'''<br />
* Second line adds our image resource '''red.bmp'''<br />
* Last line displays the content of '''test2.exe'''<br />
<br />
'''Run batch file'''<br />
<br />
Run the batch file '''test.bat''' result shown on the right.&lt;br/&gt;It clearly shows the array '''PHP''' and '''md5''' key generated<br />
<br />
Note: The md5 is converted to uppercase before being saved to the array.<br />
<br />
'''File (resource) access'''&lt;br /&gt;Access a resource using the following code format<br />
{|<br />
|-<br />
|&lt;pre&gt;<br />
res:///PHP/'.strtoupper(md5('./red.exe'))<br />
&lt;/pre&gt;<br />
|}<br />
|<br />
'''Result'''<br />
&lt;pre&gt;<br />
<br />
C:\us_wb\phc&gt;embeder2.exe new test2<br />
'.\test2.exe' created<br />
<br />
C:\us_wb\phc&gt;embeder2.exe add test2 red.bmp ./<br />
Updated 'res://.\test2.exe/PHP/0374ec857381230fa83049643ce3cdee' with 776 bytes<br />
<br />
C:\us_wb\phc&gt;embeder2.exe list test2<br />
Res list of '.\test2.exe':<br />
PHP<br />
0374EC857381230FA83049643CE3CDEE<br />
RUN<br />
RT_ICON<br />
#1<br />
#2<br />
RT_GROUP_ICON<br />
#101<br />
#24<br />
<br />
C:\us_wb\phc&gt;pause<br />
Press any key to continue . . .<br />
&lt;/pre&gt;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
== Problem ==<br />
Our application uses the following code to assign images :<br />
{|<br />
|-<br />
|<br />
&lt;pre&gt;<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2), 'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN1),'green.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2),'green.bmp', NOCOLOR); <br />
wb_set_image($mainwin, &quot;uslogo.ico&quot;); // Add logo <br />
&lt;/pre&gt;<br />
|}<br />
The above functions are expecting an image '''file path'''.<br />
<br />
This code res:///PHP/'.strtoupper(md5('./red.exe')) returns an image resource, binary content of a file.<br />
<br />
The two are incompatible hence WinBinder cannot use an image resource directly.<br />
<br />
=== Solution ===<br />
The solution is as follows: <br />
<br />
* Write the image resource to a file on disk<br />
* Allow WinBinder to assign this image file (using its path)<br />
* Once assigned, it is no longer required, so delete the image file<br />
'''''[[#top | Top]]'''''<br />
=== Code ===<br />
The code is split into three sections.<br />
<br />
* First section tests if code is running from the .exe using EMBEDED as a reference. If running from .exe, it gets the image resource as a file and saves it to disk with the original file name.<br />
* Second section contains original lines that remain unchanged.<br />
* Last section tests if code is running from the .exe and deletes the file from disk if true.<br />
<br />
This method allows code to be tested with original images. After compiling, the .exe produced is moved to folder C:\us_wb\my_dis\final for testing.<br />
{|<br />
|-<br />
|<br />
If code is running from .exe (EMBEDED true) get resource as a file and save it to disk with same file name.<br />
|<br />
&lt;pre&gt;<br />
// Assign red image to frames<br />
if(defined('EMBEDED')){ // If main exe Get image save to disk<br />
file_put_contents('./red.bmp',file_get_contents('res:///PHP/'.strtoupper(md5('./red.bmp'))));<br />
}<br />
&lt;/pre&gt;<br />
|-<br />
|<br />
These lines remain unchanged.<br />
|<br />
&lt;pre&gt;<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2), 'red.bmp', NOCOLOR); <br />
&lt;/pre&gt;<br />
|-<br />
|<br />
If running from .exe, image no longer required, so delete it.<br />
|<br />
&lt;pre&gt;<br />
if(defined('EMBEDED')){ // If main exe<br />
unlink('./red.bmp'); // Delete file <br />
}<br />
&lt;/pre&gt;<br />
|}<br />
With the exception of image name, each image requires identical code.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Modifications ==<br />
Edit file C:\us_wb\my_app\'''z_basic.phpw'''<br />
Replace these lines<br />
&lt;pre&gt;<br />
// Assign images to frames<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN1),'green.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2), 'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2),'green.bmp', NOCOLOR); <br />
&lt;/pre&gt;<br />
<br />
With<br />
&lt;pre&gt;<br />
// Assign red image to frames<br />
if(defined('EMBEDED')){ // If main exe Get image save to disk<br />
file_put_contents('./red.bmp',file_get_contents('res:///PHP/'.strtoupper(md5('./red.bmp')))); <br />
}<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED1),'red.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMERED2), 'red.bmp', NOCOLOR); <br />
if(defined('EMBEDED')){ // If main exe<br />
unlink('./red.bmp'); // Delete file <br />
}<br />
<br />
// Assign green image to frames<br />
if(defined('EMBEDED')){ // If main exe Get image save to disk<br />
file_put_contents('./green.bmp',file_get_contents('res:///PHP/'.strtoupper(md5('./green.bmp')))); <br />
}<br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN1), 'green.bmp', NOCOLOR); <br />
wb_set_image(wb_get_control($mainwin, IDC_FRAMEGREEN2), 'green.bmp', NOCOLOR); <br />
if(defined('EMBEDED')){ // If main exe<br />
unlink('./green.bmp'); // Delete file <br />
}<br />
&lt;/pre&gt;<br />
<br />
Replace this line<br />
&lt;pre&gt;<br />
wb_set_image($mainwin, &quot;uslogo.ico&quot;); // Add logo <br />
&lt;/pre&gt;<br />
With<br />
&lt;pre&gt;<br />
// Assign logo image to window<br />
if(defined('EMBEDED')){ // If main exe Get image save to disk<br />
file_put_contents('./uslogo.ico',file_get_contents('res:///PHP/'.strtoupper(md5('./uslogo.ico')))); <br />
}<br />
wb_set_image($mainwin, &quot;uslogo.ico&quot;); // Add logo <br />
if(defined('EMBEDED')){ // If main exe<br />
unlink('./uslogo.ico'); // Delete file <br />
}<br />
&lt;/pre&gt;<br />
=== Test ===<br />
* Run z_basic.bat ensure your application runs<br />
* Compile<br />
* Copy z_basic.exe to folder C:\us_wb\my_dis\final<br />
* Optional: delete image files. (Note: images will be deleted when z_basic.exe is run)<br />
* Run z_basic.exe<br />
'''''[[#top | Top]]'''''<br />
== Summary ==<br />
That completes this tutorial.<br />
<br />
To save typing you can find a completed project ready for compiling in folder C:\us_wb\phc\us_example. Copy all files to folder C:\us_wb\my_app, compile and test as above.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Conclusion ==<br />
* Designing a Windows application using WinBinder is extremely easy.<br />
<br />
* Compiling a project with PHC-Win really is a snap, and takes just a few mouse clicks.<br />
<br />
* A slight negative for a small Windows application is that the distributed code size is relatively large. This is not a significant issue, with the convenience and ease of use of PHP far outweighs this.<br />
<br />
* That said core elements of WinBinder are being actively worked on. Both Andrew (Frantik) and Alec Gorge “alecgorge” are pushing to reduce core size further; expect significant changes.<br />
<br />
* The WinBinder project remains alive and vibrant. What I really like is that you can produce very powerful Windows applications using these tools. The project is well supported and you will find numerous code examples.<br />
<br />
* If you get stuck with a problem, visit WinBinder’s friendly forum.<br />
<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
[[Category: Tutorials]]<br />
[[Category: How To]]<br />
[[Category: Uniform Server 5.0-Nano]]</div>Upazixorys