![]() |
|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hello,
Thought I have searched many forums, I have not found anything on this : I am on my first server install ![]() ![]() When I start apache, here is the result : could not resolve port "192.168.2.11" --- service not supported for ai_socktype /usr/sbin/apachectl start: httpd could not be started ![]() As written in the apache documentation for listen : Listen is now a required directive. If it is not in the config file, the server will fail to start. What I did with : Listen 192.168.2.11 If I remove this line, apache starts, but then if I try to browse my server from 192.168.2.11, I get : Forbidden You don't have permission to access /phpinfo.php on this server. It is the same with PF disabled. I need help please ![]() Last edited by lalebarde; 13th November 2008 at 11:52 PM. Reason: solved |
|
|||
![]()
First do a syntax test with apachectl
Code:
apachectl configtest The standard configuration of /var/www/conf/httpd.conf already enables a Listen on port 80 and port 443 Code:
$ grep -in listen /var/www/conf/httpd.conf 182:# Listen: Allows you to bind Apache to specific IP addresses and/or 186:#Listen 3000 187:#Listen 12.34.56.78:80 191:# is used to tell the server which IP address to listen to. It can either 193:# See also the <VirtualHost> and Listen directives. 302:# Port: The port to which the standalone server listens. For 310:## When we also provide SSL we have to listen to the 314:Listen 80 315:Listen 443 ![]() If you want to use a specific IP address then add the port specification as shown in line 187. Next step is to check whether Apache is actually LISTENing Code:
$ netstat -an -f inet Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 0 *.80 *.* LISTEN tcp 0 0 *.6000 *.* LISTEN tcp 0 0 127.0.0.1.587 *.* LISTEN tcp 0 0 127.0.0.1.25 *.* LISTEN tcp 0 0 *.22 *.* LISTEN tcp 0 0 *.515 *.* LISTEN Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) udp 0 0 192.168.222.20.7184 83.96.227.85.123 udp 0 0 192.168.222.20.11292 213.239.154.12.123 udp 0 0 192.168.222.20.35727 94.75.205.140.123 udp 0 0 192.168.222.20.4769 194.109.64.200.123 udp 0 0 192.168.222.20.15905 213.10.47.241.123 udp 0 0 *.514 *.* ![]() Did you follow the message given by the install of the PHP package? This tells you what to modify in httpd.conf.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
Last week I installed a OpenBSD current snapshot with php. This is the message I referred to in my previous post.
![]() Code:
--- php5-core-5.2.6p0 ------------------- To enable the php5 module please create a symbolic link from /var/www/conf/modules.sample/php5.conf to /var/www/conf/modules/php5.conf. ln -s /var/www/conf/modules.sample/php5.conf \ /var/www/conf/modules The recommended php configuration has been installed to /var/www/conf/php.ini. Don't forget that the default OpenBSD httpd is chrooted into /var/www by default, so you may need to create support directories such as /var/www/tmp for PHP to work correctly.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
Thanks anomie
![]() ![]() ![]() With Listen 192.168.2.11:80, apache starts. But I still have the same access forbidden message from my browser. Though in <Directory "/var/www/htdocs">, I have put : Order deny,allow Deny from all Allow from 192.168.2.11 BTW, what book of Apache do you advise (english or french) ? My version of appache is the one embedded at installation with OpenBSD 4.4. It seems it is apache-httpd-2.2.8.tgz - but I am not sure since pkg_info provides info from repository and not from installed version, and I still don't know how to get this information ![]() |
|
|||||
![]()
Thanks J5nko,
Quote:
Quote:
191:Listen 192.168.2.11:443 323:Listen 80 324:Listen 443 ok, I am not consistent here but it should be ok. For the trial, I suppress the ip specification, and let only the port. I am still forbidden. Quote:
tcp 0 0 192.168.2.20.80 192.168.2.10.54875 TIME_WAIT tcp 0 0 *.80 *.* LISTEN tcp 0 0 *.443 *.* LISTEN tcp 0 0 *.22 *.* LISTEN tcp 0 0 *.37 *.* LISTEN tcp 0 0 *.13 *.* LISTEN tcp 0 0 127.0.0.1.587 *.* LISTEN tcp 0 0 127.0.0.1.25 *.* LISTEN udp 0 0 192.168.2.20.31537 88.191.17.134.123 udp 0 0 127.0.0.1.512 *.* udp 0 0 192.168.2.20.24521 88.191.11.98.123 udp 0 0 192.168.2.20.8367 88.191.47.13.123 udp 0 0 192.168.2.20.11927 91.121.138.209.123 udp 0 0 192.168.2.20.39243 81.93.183.116.123 udp 0 0 *.514 *.* 192.168.2.10 is another PC with windows. The one with which I try to connect to the server .20 is .11 Quote:
Quote:
ln -s /var/www/conf/modules-sample/php5.conf /var/www/conf/modules ln -s /var/www/conf/modules-sample/mysql.ini /var/www/conf/php5/mysql.ini vi /var/www/conf/httpd.conf : uncomment AddTyp application/x-httpd-php .php I put also : ServerTokens ProductOnly Other clue ? |
|
|||
![]()
Thanks DutchDaemon,
Apache 1.3.29 PHP 5.2.6 |
|
||||
![]() Quote:
I also just received "Apache Security" by Ivan Ristic as a birthday gift, and I am about 1/3 finished with it. So far it has provided great info on securing Apache web server and PHP (running as a module or CGI).
__________________
Kill your t.v. |
|
||||
![]() Quote:
Check filesystem permissions for /var/www/htdocs and any file it contains. Does the user httpd is running as have read access to them? Also, add another allow line below the one you have, because it looks like you're browsing the web server from itself. Change to: Code:
Order deny,allow Deny from all Allow from 192.168.2.11 Allow from 127.0.0.1
__________________
Kill your t.v. Last edited by anomie; 13th November 2008 at 02:17 AM. Reason: clarified allow directive. |
|
||||
![]()
When you say that you are trying to browse the server, what is the url you are going to?
http://<hostname>/ , or http://<hostname>/phpinfo.php ? If the later, just check if user http can read phpinfo.php. Code:
$ cd /<your document root> $ ls -l
__________________
The only dumb question is a question not asked. The only dumb answer is an answer not given. |
|
|||
![]() Quote:
![]() If I do a http://localhost/test.php the following displays OK in firefox and lynx: Code:
# cat /var/www/htdocs/test.php <html> <head> <title>This is a test</title> </head> <body> <h1>A test for PHP</h1> <?php echo '<p>A simple test for PHP</p>' ; $name='J65nko' ; echo <<<END <p> Another parapgraph, this time created with a here document. </p> <p>You can also use variables</p> <p>Take care, </p> <p>$name </p> END; ?> </body> </html> ![]() Code:
# find /var/www -name 'phpinfo*' #
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||||||
![]()
Hello anomie, robbak, J65nko,
Thanks a lot for your replies. anomie, Quote:
Quote:
Quote:
Anyway, if I allow 127.0.0.1, ma browser is still forbidden. robbak, Quote:
Quote:
ls -l drwxr-xr-x 2 root Wheel bgplg -r--r--r-- 1 root bin blowfish.jpg -r--r--r-- 1 root bin bsd_small.gif -r--r--r-- 1 root bin index.html -r--r--r-- 1 root bin lock.gif -r--r--r-- 1 root bin logo23.jpg -r--r--r-- 1 root bin logo24.jpg -r--r--r-- 1 root bin mod_ssl_sb.gif -r--r--r-- 1 root bin openbsd_pb.gif -r--r--r-- 1 root bin openbsdpower.gif -r--r--r-- 1 root bin openssl_ics.gif -rw-r--r-- 1 root bin phpinfo.php -r--r--r-- 1 root bin smalltitle.gif It looks to me everyuser has read access. Quote:
Forbidden You don't have permission to access /test.php on this server. Quote:
|
|
|||
![]() Quote:
<Directory "/var/www/htdocs"> Order allow,deny Allow from all </Directory> ![]() ![]() ![]() ![]() ![]() ![]() I have to dig again in the documentation for this stuff. I close the thread. THANKS A LOT ALL OF YOU |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
thinkpad x200 or similar owners pleas help getting started | gosha | General Hardware | 1 | 14th July 2009 04:06 AM |
Trying to get started translating OpenBSD Documentaion | qmemo | OpenBSD General | 6 | 12th July 2009 12:50 PM |
Pf Nat getting started ?? | neurosis | FreeBSD Security | 11 | 16th November 2008 08:58 PM |
can't start apache "httpd not running" | disappearedng | FreeBSD General | 5 | 22nd September 2008 10:18 PM |
Getting started with DTrace | tanked | FreeBSD General | 2 | 25th June 2008 09:21 AM |