27.02.2015

Debian 7 Development Maschine mit Python - und PHP Server


sudo apt-get install ssh
apt-get install lighttpd
image
image
apt-cache search ftp-server

apt-get install vsftpd
image

nano /etc/vsftpd.conf


  • anonymous_enable = NO
  • local_enable=YES
  • write_enable=YES

service vsftpd restart

image



apt-get install chkconfig

chkconfig vsftpd on 
apt-get install php5-cgi
in /etc/lighttpd/lighttpd.conf: 

server.modules = … "mod_fastcgi",



und am ende der Datei
fastcgi.server = ( ".php" => (( 
                    "bin-path" => "/usr/bin/php-cgi",
                    "socket" => "/tmp/php.sock" 
                )))

(s. http://www.df.eu/de/service/df-faq/cloudserver/anleitungen/lighttpd-und-php-installieren-debian-ubuntu/ )
service lighttpd restart




echo "<?php phpinfo(); ?>" > /var/www/test.php
 
image
apt-get install python
image 
Python Socket Server 

import socket
import logging
print "Hello, World!"
s = socket.socket()
print "sochet %s", s
host = socket.gethostname()
port = 1234
s.bind((host, port))
s.listen(5)
while True:
    c, addr = s.accept()
    print 'Got connection from', addr
    c.send('Thank you for connecting')
    c.close()
 
Python socket Client
import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.connect((host, port))
print s.recv(1024)
image



image






Keine Kommentare:

Kommentar veröffentlichen