SHARE
TWEET

et up a server with Apache , PHP and more

vxpz Sep 19th, 2019 1,528 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How to set up a server with Apache , PHP , MySQL , Perl , phpMyAdmin
  2.  
  3. =====
  4.  
  5. Let's start by installing apache (http server) . you can download the
  6. apache installer on www.apache.org . download the verion you like ,
  7. even thought , in win systems i recomand verion 2 (this tutorials is
  8. for apache 2) . here is a link for it :
  9.  
  10. Code:
  11. http://apache.mirror.nedlinux.nl/dist/httpd/binaries/win32/apache_2.0.52-win32-x86-no_ssl.msi
  12.  
  13.  
  14. for a faster mirror , visit http://httpd.apache.org/download.cgi .
  15.  
  16. After downloading the file (.msi installer) , run it . The installation wizard
  17. is a next , next , finish 'work' ... The installer will ask you some details like
  18. your server name , your server adress and the admin's mail adress . if
  19. you have a domain name or a hostname , enter the info's like this :
  20.  
  21. Code:
  22. Server Name : your_domain.org
  23.  
  24. Server Adress : www.your-domain.org
  25.  
  26. Admin Email : admin@yourdomain.org
  27.  
  28.  
  29. if you don't have one , you should get on e free at :
  30.  
  31. Code:
  32. http://www.no-ip.org/
  33.  
  34.  
  35. Check the 'Run as a service for all users on port 8080' option and click
  36. next , finish to fiinish the instllation . Advice : Install it in c: (he creates
  37. a folder for it , don't worry) to make sure you configure it easyer .
  38. If you are finished , open up a browser and write in the adress bar :
  39.  
  40. Code:
  41. http://localhost/
  42.  
  43.  
  44. If you will see a 'Test Page for Apache Installation' , everything works .
  45.  
  46. =====
  47.  
  48. Let's install PHP . download the archives from www.php.net . Here is a
  49. direct link for verion 4.3.9 :
  50.  
  51. Code:
  52. http://nl.php.net/get/php-4.3.9-Win32.zip/from/this/mirror
  53.  
  54.  
  55. Make sure you download the archive and not the installer . Ok! after
  56. downloading it , extract the archive in c:/php (this is to simplify paths) .
  57. Now , open up c:/apache/conf/httpd.conf and search for this line :
  58.  
  59. Code:
  60. #LoadModule ssl_module modules/mod_ssl.so
  61.  
  62.  
  63. under that line , add this :
  64.  
  65. Code:
  66. LoadModule rewrite_module modules/mod_rewrite.so
  67.  
  68. LoadModule php4_module "c:/php/sapi/php4apache2.dll"
  69. AddType application/x-httpd-php .php
  70. AddType application/x-httpd-php .php3
  71. AddType application/x-httpd-php .php4
  72.  
  73.  
  74. Now search for this line :
  75.  
  76. Code:
  77. <Directory "C:/Apache2/htdocs">
  78.  
  79.  
  80. Change :
  81.  
  82. Code:
  83. Options Indexes FollowSymLinks
  84.  
  85. #
  86. # AllowOverride controls what directives may be placed in .htaccess files.
  87. # It can be "All", "None", or any combination of the keywords:
  88. #   Options FileInfo AuthConfig Limit
  89. #
  90.     AllowOverride None
  91.  
  92.  
  93. into :
  94.  
  95. Code:
  96. Options Indexes Includes FollowSymLinks MultiViews ExecCGI
  97.  
  98. #
  99. # AllowOverride controls what directives may be placed in .htaccess files.
  100. # It can be "All", "None", or any combination of the keywords:
  101. #   Options FileInfo AuthConfig Limit
  102. #
  103.     AllowOverride All
  104.  
  105.  
  106. This will allow .htaccess support on your server and make sure you can
  107. see the content of a folder without getting a 403 forbidden error .
  108.  
  109. Now search for :
  110.  
  111. Code:
  112. DirectoryIndex index.html index.var.html
  113.  
  114.  
  115. and change it into :
  116.  
  117. Code:
  118. DirectoryIndex index.html index.php
  119.  
  120.  
  121. Save the file and restart apache . (you can restart it by pressing the
  122. Restart apache server shortcut in the start menu or by writing :
  123.  
  124. Code:
  125. net apache restart
  126.  
  127.  
  128. in a command prompt window . Ok!
  129.  
  130. you have php working for your server icon_wink.gif . Now let's configure php and
  131. make sure it really works ! Open up c:/php/php.ini (php.ini-dist renamed)
  132. and search for this paragraph :
  133.  
  134. Code:
  135. max_execution_time = 60    ; Maximum execution time of each script, in seconds
  136. max_input_time = 60   ; Maximum amount of time each script may spend parsing request data
  137. memory_limit = 5M      ; Maximum amount of memory a script may consume (8MB)
  138.  
  139.  
  140. you should change this to whatever you want . here is an option i use :
  141.  
  142. Code:
  143. max_execution_time = 300    ; Maximum execution time of each script, in seconds
  144. max_input_time = 300   ; Maximum amount of time each script may spend parsing request data
  145. memory_limit = 5M      ; Maximum amount of memory a script may consume (8MB)
  146.  
  147.  
  148. Now search for :
  149.  
  150. Code:
  151. register_globals = Off
  152.  
  153.  
  154. and change it into :
  155.  
  156. Code:
  157. register_globals = On
  158.  
  159.  
  160. Search for :
  161.  
  162. Code:
  163. extension_dir = ".\"
  164.  
  165.  
  166. and change it into :
  167.  
  168. Code:
  169. extension_dir = "c:/php/extensions"
  170.  
  171.  
  172. assuming you have installed php in c: ...
  173.  
  174. Search for :
  175.  
  176. Code:
  177. ;Windows Extensions
  178. ;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
  179.  
  180.  
  181. and uncomment (delete the ; in the front) the following modules :
  182.  
  183. Code:
  184. extension=php_bz2.dll
  185. extension=php_db.dll
  186. extension=php_gd2.dll
  187. extension=php_java.dll
  188. extension=php_msql.dll
  189. extension=php_pdf.dll
  190. extension=php_pgsql.dll
  191. extension=php_sockets.dll
  192.  
  193.  
  194. Ok! now let's change the smtp settings (this is good icon_smile.gif for you mail()
  195. function . you need this !!!) Search for :
  196.  
  197. Code:
  198. [mail function]
  199. ; For Win32 only.
  200. SMTP =
  201. smtp_port = 25
  202.  
  203. ; For Win32 only.
  204. ;sendmail_from =
  205.  
  206.  
  207. and change to :
  208.  
  209. Code:
  210. [mail function]
  211. ; For Win32 only.
  212. SMTP = mail.isp.org
  213. smtp_port = 25
  214.  
  215. ; For Win32 only.
  216. sendmail_from = mail@your_domain.org
  217.  
  218. if you don't have a mail server or :
  219.  
  220. Code:
  221. [mail function]
  222. ; For Win32 only.
  223. SMTP = localhost
  224. smtp_port = 25
  225.  
  226. ; For Win32 only.
  227. sendmail_from = mail@your_domain.org
  228.  
  229. if you have a mail server ...
  230.  
  231. Save the files . Now let's finalize the php installation . copy all the dll's
  232. from c:/php/dlls into c:/windows/system32 . copy c:/php/php4ts.dll into
  233. c:/windows/system32/ and copy php.ini from your folder php into
  234. windows and system32 folder . restart apache . open up notepad and
  235. add this into the file :
  236.  
  237. Code:
  238. <?php
  239.    phpinfo();
  240. ?>
  241.  
  242.  
  243. save this file in your htdocs folder (c:/apache/htdocs) as info.php and
  244. open up a browser . in the adress bar write :
  245.  
  246. Code:
  247. http://localhost/info.php
  248.  
  249.  
  250. you should see php's configuration in a table . a looong file icon_smile.gif
  251. you can optionaly install zend optimizer . i am using it ... it doesn't
  252. needs a tutorial . to install the PEAR modules for php , just run the
  253. go-pear batch from the php folder and 2click the reg file to finish the
  254. instllation .
  255.  
  256. =====
  257.  
  258. let's install mysql . download mysql from http://www.mysql.com/ .
  259. this tutorial applyes to verion 4.0.* ... i don't recomand using mysql
  260. 4.1 . here is a direct link :
  261.  
  262. Code:
  263. http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.22-win.zip/from/http://mysql.proserve.nl/
  264.  
  265.  
  266. after downloading , extract the arhive somewhere and run the setup.exe .
  267. install mysql in c:/mysql and complete the installation . open up command
  268. prompt and write this :
  269.  
  270. Code:
  271. cd mysql
  272. cd bin
  273. mysqld-max-nt --install
  274.  
  275.  
  276. this will install mysql as a service . recomended . now you would probably
  277. consider downloading mysql control center . a gui tool to administrate the
  278. server in a graphical mode . here is a link :
  279.  
  280. Code:
  281. http://dev.mysql.com/get/Downloads/MySQLCC/mysqlcc-0.9.4-win32.zip/from/http://mysql.proserve.nl/
  282.  
  283.  
  284. install it like any other program and run the shortcut in the desktop . a
  285. window will pop-up . it will ask you to add a new connection . here are the
  286. info's you need to fill in :
  287.  
  288. Code:
  289. name : localhost or main or whatever :)
  290. host : localhost
  291. user : root
  292. pass :
  293.  
  294.  
  295. click add , expand the databases menu and delete databse text . now
  296. expand the users menu and delete all users except root@localhost . right
  297. click it and select edit user . change it's password to whatever you want icon_smile.gif
  298. now right click the server and select edit . change the password to the
  299. pass you chosed for user root . as easy as that . mysql is installed !
  300.  
  301. =====
  302.  
  303. phpMyADmin . you can download it from http://www.phpmyadmin.net/ .
  304. i recommend using verion 2.5.1 pl1 . the last verion is still bugy icon_smile.gif
  305. download , unzip the contecnt into a folder in htdocs (phpMyAdmin) and
  306. open up config.inc.php with a text editor .
  307.  
  308. search for :
  309.  
  310. Code:
  311. $cfg['PmaAbsoluteUri'] = '';
  312.  
  313.  
  314. change it to your phpmyadmin url . eg. :
  315.  
  316. Code:
  317. $cfg['PmaAbsoluteUri'] = http://www.your_domain.org/phpMyAdmin/';
  318.  
  319.  
  320. now search for :
  321.  
  322. Code:
  323. $cfg['blowfish_secret'] = '';
  324.  
  325.  
  326. and change it to your mysql root password like this :
  327.  
  328. Code:
  329. $cfg['blowfish_secret'] = 'password';
  330.  
  331.  
  332. now search for :
  333.  
  334. Code:
  335. $cfg['Servers'][$i]['auth_type']     = 'config';
  336.  
  337.  
  338. and change it to :
  339.  
  340. Code:
  341. $cfg['Servers'][$i]['auth_type']     = 'cookie';
  342.  
  343.  
  344. save and exit . that's it ! phpMyAdmin works icon_wink.gif
  345.  
  346. =====
  347.  
  348. Perl . Optioanl for your server , very usefull . i recomend you to install
  349. it . you can download it from http://www.activestate.com/ . here is a
  350. direct link :
  351.  
  352. Code:
  353. http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.4.810-MSWin32-x86.msi
  354.  
  355.  
  356. download , install and you are ready . put your perl scripts in the /cgi-bin/
  357. folder (c:/apache/cgi-bin) .
  358.  
  359. =====
  360.  
  361. Hope this helped , you're welcome . No , you don't need to pay
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top