-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL_WIN32.txt
124 lines (89 loc) · 4.13 KB
/
INSTALL_WIN32.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
INSTALLING astahttpd on Windows
===============================
System Requirements
===================
* Windows 2000 or later
* PHP >= 5.2.x (Tested with PHP 5.2.3)
You can get PHP at http://www.php.net/
INSTALLING PHP
==============
You can skip this step if you have already install PHP.
- The Easy Way
The most easiest way to install PHP on Windows is from ready distribution
such as XAMPP (http://www.apachefriends.org/).
- Not So Easy
1. Get the zip version of PHP from http://www.php.net/.
2. Extract to a new location i.e. C:\php5.2.3
3. Rename php.ini-dist to php.ini
Configuring PHP
---------------
astahttpd need sockets and zlib extension so you need activate it. Open
php.ini and activate php_sockets.dll. So remove ";" in front of
extentension=php_sockets.dll.
Note: Zlib function is built-in in Windows version of PHP.
====================
INSTALLING astahttpd
====================
Installing astahttpd is very simple, you just need do git clone
from github or download the tarball.
$ git clone git@github.com:astasoft/astahttpd
$ cd astahttpd
$ cp conf/aws.conf.php.sample conf/aws.conf.php
$ php bin/aws
Open your web browser and point to http://localhost:8000
* Hit Ctrl-C if you want to quit/stop the daemon.
=====================
CONFIGURING astahttpd
=====================
All server configuration saved in aws.conf.php which located inside conf
folder on your instalation directory.
By default astahttpd wil run on port 80, you can change
this by editing aws.conf.php.
If $aws_conf['doc_root'] is empty, astahttpd will use default htdocs dir.
INSTALLING MODULES
==================
If you want install module there two main steps:
1. Put the module into modules directory
2. Activate the modules via aws.conf.php file
Here example configuration of modules:
$aws_conf['modules'] = array(
'mod_test' => 'Off',
'mod_encoding' => 'On',
'mod_auth_basic' => 'On',
'mod_auth_digest' => 'On',
'mod_bandwidth' => 'On',
'mod_cgi' => 'On',
'mod_cgi_header' => 'On',
'mod_vhost' => 'On',
'mod_rewrite' => 'On',
'mod_status' => 'On'
);
NOTE:
---------------------------------------------------------------------------
If you want to develop your own module, please follow these rules:
1. Every module MUST extends Module (module.php)
2. Every module MUST have method named activate() with access public
3. Call parent::__construct() on your constructor class to make sure
everything is assigned properly
4. Module name must be in lowercase, and if it consist more than one word
(I think always :)) separate it with underscore.
5. Module file name must be the same with the class name. If your class
module name is mod_test then your module file name must be mod_test.php
Read module.php so you familiar with all the global variables. For quick
example see file mod_test.php, it will show you the basic. Don't forget
to activate it on aws.conf.php.
VIRTUAL HOST CONFIGURATION
==========================
As a developer you may work on multiple projects at the same time. So
it's better to make real simulation for your project. That's why virtual
host support was added to astahttpd.
Since v0.1-RC1 the IP based virtual host support was dropped. So only name
based virtual host is supported since v0.1-RC1
Take a look at aws.conf file located in conf folder. It will gives you a lot
of example how to configure your virtual host.
Note:
When you install astahttpd, it modifiy your X:\Windows\system32\drivers\etc\hosts
file and add these content:
127.0.0.1 local.vhost1 local.vhost2
Try to access http://local.vhost1:8000/ and http://local.vhost2:8000/
to see if it works.