Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f975fd7c
Commit
f975fd7c
authored
Apr 13, 1999
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better commented start script.
parent
54031cdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
166 additions
and
42 deletions
+166
-42
ZServer/start.py
ZServer/start.py
+83
-21
lib/python/ZServer/start.py
lib/python/ZServer/start.py
+83
-21
No files found.
ZServer/start.py
View file @
f975fd7c
#!/usr/local/bin/python1.5.1
"""ZServer start script
"""ZServer
configuration and
start script
This start script configures ZServer.
You should make a copy of this file, then add, change or comment out
appropriately. Then you can start up the server by simply typing
XXX comment this script much more to explain
what the different config option are.
python start.py
You may also want to use a shell script (under Unix) or a bath file (under
win32) to set environment variables and run this script.
For more information on Medusa see http://www.nightmare.com/medusa/
"""
# Zope configuration
#
SOFTWARE_HOME
=
'd:
\
\
program files
\
\
1.10.2'
import
sys
,
os
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
SOFTWARE_HOME
,
'lib'
,
'python'
))
import
os
# ZServer configuration
#
### Zope configuration
###
# This should point to your Zope directory
INSTANCE_HOME
=
'd:
\
\
program files
\
\
1.10.2'
### ZServer configuration
###
## HTTP configuration
##
# This is the IP address of the network interface you want your servers to
# be visible from. This can be changed to '' to listen on all interfaces.
IP_ADDRESS
=
''
HOST
=
'localhost'
# Host name of the server machine. You may use 'localhost' if your server
# doesn't have a host name.
HOSTNAME
=
'localhost'
# IP address of your DNS server. If you have DNS service on your local machine
# then you can set this to '127.0.0.1'
DNS_IP
=
'205.240.25.3'
# Port for HTTP Server. The standard port for HTTP services is 80.
HTTP_PORT
=
9673
FTP_PORT
=
8021
PCGI_PORT
=
88889
PID_FILE
=
os
.
path
.
join
(
SOFTWARE_HOME
,
'var'
,
'ZServer.pid'
)
LOG_FILE
=
os
.
path
.
join
(
SOFTWARE_HOME
,
'var'
,
'ZServer.log'
)
# Module to publish. If you are not using the Zope management framework,
# this should be the name of your published module. Note that this module
# must be accessible in the Python path.
MODULE
=
'Main'
# Location of the ZServer log file. This file logs all ZServer activity.
# You may wish to create different logs for different servers. See
# medusa/logger.py for more information.
LOG_FILE
=
os
.
path
.
join
(
INSTANCE_HOME
,
'var'
,
'ZServer.log'
)
## FTP configuration
##
# Port for the FTP Server. The standard port for FTP services is 21.
FTP_PORT
=
8021
## PCGI configuration
# You can configure the PCGI server manually, or have it read its
# configuration information from a PCGI info file.
PCGI_FILE
=
os
.
path
.
join
(
INSTANCE_HOME
,
'Zope.cgi'
)
# Add Zope to the Python path first.
# If you are using a binary release of Zope, you may need
# to add additional paths here.
#
import
sys
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
INSTANCE_HOME
,
'lib'
,
'python'
))
from
medusa
import
resolver
,
logger
,
http_server
,
asyncore
from
HTTPServer
import
zhttp_server
,
zhttp_handler
from
PCGIServer
import
PCGIServer
from
FTPServer
import
FTPServer
## ZServer startup
##
# To disable some of the servers simply comment out the relevant stanzas.
# Resolver and Logger, used by other servers
rs
=
resolver
.
caching_resolver
(
DNS_IP
)
lg
=
logger
.
file_logger
(
LOG_FILE
)
# HTTP Server
hs
=
zhttp_server
(
ip
=
IP_ADDRESS
,
port
=
HTTP_PORT
,
...
...
@@ -43,22 +93,34 @@ hs = zhttp_server(
zh
=
zhttp_handler
(
MODULE
,
''
)
hs
.
install_handler
(
zh
)
# PCGI Server
zpcgi
=
PCGIServer
(
module
=
MODULE
,
ip
=
IP_ADDRESS
,
port
=
PCGI_PORT
,
pid_file
=
PID_FILE
,
pcgi_file
=
PCGI_FILE
,
resolver
=
rs
,
logger_object
=
lg
)
# FTP Server
zftp
=
FTPServer
(
module
=
MODULE
,
hostname
=
HOST
,
hostname
=
HOST
NAME
,
port
=
FTP_PORT
,
resolver
=
rs
,
logger_object
=
lg
)
# Try to become nobody. This will only work if this script is run by root.
try
:
import
pwd
try
:
nobody
=
pwd
.
getpwnam
(
'nobody'
)[
2
]
except
pwd
.
error
:
nobody
=
1
+
max
(
map
(
lambda
x
:
x
[
2
],
pwd
.
getpwall
()))
os
.
setuid
(
nobody
)
except
:
pass
# Start Medusa
asyncore
.
loop
()
lib/python/ZServer/start.py
View file @
f975fd7c
#!/usr/local/bin/python1.5.1
"""ZServer start script
"""ZServer
configuration and
start script
This start script configures ZServer.
You should make a copy of this file, then add, change or comment out
appropriately. Then you can start up the server by simply typing
XXX comment this script much more to explain
what the different config option are.
python start.py
You may also want to use a shell script (under Unix) or a bath file (under
win32) to set environment variables and run this script.
For more information on Medusa see http://www.nightmare.com/medusa/
"""
# Zope configuration
#
SOFTWARE_HOME
=
'd:
\
\
program files
\
\
1.10.2'
import
sys
,
os
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
SOFTWARE_HOME
,
'lib'
,
'python'
))
import
os
# ZServer configuration
#
### Zope configuration
###
# This should point to your Zope directory
INSTANCE_HOME
=
'd:
\
\
program files
\
\
1.10.2'
### ZServer configuration
###
## HTTP configuration
##
# This is the IP address of the network interface you want your servers to
# be visible from. This can be changed to '' to listen on all interfaces.
IP_ADDRESS
=
''
HOST
=
'localhost'
# Host name of the server machine. You may use 'localhost' if your server
# doesn't have a host name.
HOSTNAME
=
'localhost'
# IP address of your DNS server. If you have DNS service on your local machine
# then you can set this to '127.0.0.1'
DNS_IP
=
'205.240.25.3'
# Port for HTTP Server. The standard port for HTTP services is 80.
HTTP_PORT
=
9673
FTP_PORT
=
8021
PCGI_PORT
=
88889
PID_FILE
=
os
.
path
.
join
(
SOFTWARE_HOME
,
'var'
,
'ZServer.pid'
)
LOG_FILE
=
os
.
path
.
join
(
SOFTWARE_HOME
,
'var'
,
'ZServer.log'
)
# Module to publish. If you are not using the Zope management framework,
# this should be the name of your published module. Note that this module
# must be accessible in the Python path.
MODULE
=
'Main'
# Location of the ZServer log file. This file logs all ZServer activity.
# You may wish to create different logs for different servers. See
# medusa/logger.py for more information.
LOG_FILE
=
os
.
path
.
join
(
INSTANCE_HOME
,
'var'
,
'ZServer.log'
)
## FTP configuration
##
# Port for the FTP Server. The standard port for FTP services is 21.
FTP_PORT
=
8021
## PCGI configuration
# You can configure the PCGI server manually, or have it read its
# configuration information from a PCGI info file.
PCGI_FILE
=
os
.
path
.
join
(
INSTANCE_HOME
,
'Zope.cgi'
)
# Add Zope to the Python path first.
# If you are using a binary release of Zope, you may need
# to add additional paths here.
#
import
sys
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
INSTANCE_HOME
,
'lib'
,
'python'
))
from
medusa
import
resolver
,
logger
,
http_server
,
asyncore
from
HTTPServer
import
zhttp_server
,
zhttp_handler
from
PCGIServer
import
PCGIServer
from
FTPServer
import
FTPServer
## ZServer startup
##
# To disable some of the servers simply comment out the relevant stanzas.
# Resolver and Logger, used by other servers
rs
=
resolver
.
caching_resolver
(
DNS_IP
)
lg
=
logger
.
file_logger
(
LOG_FILE
)
# HTTP Server
hs
=
zhttp_server
(
ip
=
IP_ADDRESS
,
port
=
HTTP_PORT
,
...
...
@@ -43,22 +93,34 @@ hs = zhttp_server(
zh
=
zhttp_handler
(
MODULE
,
''
)
hs
.
install_handler
(
zh
)
# PCGI Server
zpcgi
=
PCGIServer
(
module
=
MODULE
,
ip
=
IP_ADDRESS
,
port
=
PCGI_PORT
,
pid_file
=
PID_FILE
,
pcgi_file
=
PCGI_FILE
,
resolver
=
rs
,
logger_object
=
lg
)
# FTP Server
zftp
=
FTPServer
(
module
=
MODULE
,
hostname
=
HOST
,
hostname
=
HOST
NAME
,
port
=
FTP_PORT
,
resolver
=
rs
,
logger_object
=
lg
)
# Try to become nobody. This will only work if this script is run by root.
try
:
import
pwd
try
:
nobody
=
pwd
.
getpwnam
(
'nobody'
)[
2
]
except
pwd
.
error
:
nobody
=
1
+
max
(
map
(
lambda
x
:
x
[
2
],
pwd
.
getpwall
()))
os
.
setuid
(
nobody
)
except
:
pass
# Start Medusa
asyncore
.
loop
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment