2007-11-20, 16:15
#1
ps axf | grep apache2 netstat -nlp | grep \:80
vi /etc/apache2/sites-available/default eller nano -w /etc/apache2/sites-available/default
/etc/init.d/apache2 restart
links http://localhost/index.html (apt-get install links om du inte har den, consolebaserad webbrowser) eller telnet localhost 80 ...lyckas telnet connecta, skriv följande och tryck enter två gånger, så ska du få en bunt html tillbaks. GET /index.html HTTP/1.0 eller GET / HTTP/1.0
apt-get install net-tools mii-tool eth0
sudo apache2ctl configtest Syntax OK
sudo ps axf | grep apache2 6507 pts/1 S+ 0:00 | \_ grep apache2 6492 ? Ss 0:00 /usr/sbin/apache2 -k start 6493 ? S 0:00 \_ /usr/sbin/apache2 -k start 6494 ? S 0:00 \_ /usr/sbin/apache2 -k start 6495 ? S 0:00 \_ /usr/sbin/apache2 -k start 6499 ? S 0:00 \_ /usr/sbin/apache2 -k start 6500 ? S 0:00 \_ /usr/sbin/apache2 -k start 6502 ? S 0:00 \_ /usr/sbin/apache2 -k start sudo netstat -nlp | grep \:80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6492/apache2
telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /index.html HTTP/1.0 HTTP/1.1 200 OK Date: Fri, 23 Nov 2007 14:42:39 GMT Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6 Last-Modified: Fri, 23 Nov 2007 14:15:47 GMT ETag: "6701c0-107-403b0ac0" Accept-Ranges: bytes Content-Length: 263 Connection: close Content-Type: text/html <html>Massor med HTML</html> Connection closed by foreign host.
sudo ps axf | grep apache2 6507 pts/1 S+ 0:00 | \_ grep apache2 6492 ? Ss 0:00 /usr/sbin/apache2 -k start 6493 ? S 0:00 \_ /usr/sbin/apache2 -k start 6494 ? S 0:00 \_ /usr/sbin/apache2 -k start 6495 ? S 0:00 \_ /usr/sbin/apache2 -k start 6499 ? S 0:00 \_ /usr/sbin/apache2 -k start 6500 ? S 0:00 \_ /usr/sbin/apache2 -k start 6502 ? S 0:00 \_ /usr/sbin/apache2 -k start sudo netstat -nlp | grep \:80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6492/apache2
telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /index.html HTTP/1.0 HTTP/1.1 200 OK Date: Fri, 23 Nov 2007 14:42:39 GMT Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6 Last-Modified: Fri, 23 Nov 2007 14:15:47 GMT ETag: "6701c0-107-403b0ac0" Accept-Ranges: bytes Content-Length: 263 Connection: close Content-Type: text/html <html>Massor med HTML</html> Connection closed by foreign host.
<?php phpinfo(); ?>
HTTP/1.1 200 OK Date: Fri, 23 Nov 2007 14:42:39 GMT Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6 Last-Modified: Fri, 23 Nov 2007 14:15:47 GMT ETag: "6701c0-107-403b0ac0" Accept-Ranges: bytes Content-Length: 263 Connection: close Content-Type: text/html
<VirtualHost *:80> ServerName www.site1.se ServerAlias www2.site1.se ServerAlias site1.se DocumentRoot /var/www/www.site1.se CustomLog /var/log/apache2/www.site1.se-access.log combined ErrorLog /var/log/apache2/www.site1.se-error.log LogLevel warn </VirtualHost>
cd /etc/apache2/sites-enabled ln -s ../sites-available/www.site1.se www.site1.se
telnet localhost 80 GET / HTTP/1.0 Host: www.site1.se enter, enter
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106