DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st March 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default can not star Apache web server.

Apache webserver won't start when i do
Code:
/usr/sbin/apachectl start
I just wait and nothing happens...
Reply With Quote
  #2   (View Single Post)  
Old 31st March 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Question #1: What is the value of httpd_flags on this system?

Hint: to obtain the answer, issue the following command. Note that this command will check the results in both rc.conf and rc.conf.local, if you use the latter.
$ grep httpd_flags /etc/rc.conf*
Question #2: Is Apache already running?

Hint: to obtain the answer, issue the following command. No response means that Apache is not running. Processes listed means that Apache is already running.
$ pgrep -lf httpd
Reply With Quote
  #3   (View Single Post)  
Old 31st March 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

$ grep httpd_flags /etc/rc.conf*

it returns httpd_flags=NO but then i change it to flags="" and put the line to rc.conf.local and i restart the machine. The service loaded from sendmail until httpd and stops there for long time. I think it cannot start so i Ctrl+ C to cancel it.

Do I need to install apache package from the web? Because i thought apache is included in the default setup.
Reply With Quote
  #4   (View Single Post)  
Old 31st March 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

OpenBSD includes a secured Apache 1.3, with additional features such as integrated SSL/TLS and DSO.

As you have discovered, this is normally started via rc(8) and configured in rc.conf.local(5). It is described in httpd(8) and discussed in FAQ 10.16.

It appears that this built-in httpd is not working on your system. It appears to hang, rather than start.

There are no bug reports with this symptom, so I begin to suspect your configuration.

Question 3: Have you ever changed, added, or removed any files in /var/www?

Question 4: I'd like to know all about your OS, and your hardware configuration. Rather than ask you eight different questions, and have you try to answer them, please just post your dmesg.
Reply With Quote
  #5   (View Single Post)  
Old 1st April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

I never touch /var/www before. Here's my dmesg
Code:
# dmesg
OpenBSD 4.4 (GENERIC) #1021: Tue Aug 12 17:16:55 MDT 2008
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Genuine Intel(R) CPU T2050 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,SSE3
real mem  = 267939840 (255MB)
avail mem = 250646528 (239MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 04/10/07, BIOS32 rev. 0 @ 0xfd880, SMBIOS rev. 2.31 @ 0xe0010 (45 entries)
bios0: vendor Phoenix Technologies LTD version "6.00" date 04/10/2007
bios0: VMware, Inc. VMware Virtual Platform
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
acpi at bios0 function 0x0 not configured
pcibios0 at bios0: rev 2.1 @ 0xfd880/0x780
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdf30/176 (9 entries)
pcibios0: PCI Interrupt Router at 000:07:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #2 is the last bus
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x1000 0xdc000/0x4000! 0xe0000/0x4000!
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82443BX AGP" rev 0x01
ppb0 at pci0 dev 1 function 0 "Intel 82443BX AGP" rev 0x01
pci1 at ppb0 bus 1
piixpcib0 at pci0 dev 7 function 0 "Intel 82371AB PIIX4 ISA" rev 0x08
pciide0 at pci0 dev 7 function 1 "Intel 82371AB IDE" rev 0x01: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <VMware Virtual IDE Hard Drive>
wd0: 64-sector PIO, LBA, 10240MB, 20971520 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets, initiator 7
cd0 at scsibus0 targ 0 lun 0: <PHILIPS, CDRW/DVD SCB5265, TX11> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
piixpm0 at pci0 dev 7 function 3 "Intel 82371AB Power" rev 0x08: SMBus disabled
vga1 at pci0 dev 15 function 0 "VMware Virtual SVGA II" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
drm at vga1 unsupported
bha3 at pci0 dev 16 function 0 "BusLogic MultiMaster" rev 0x01: irq 11, BusLogic 9xxC SCSI
bha3: model BT-958, firmware 5.07B
bha3: sync, parity
scsibus1 at bha3: 8 targets, initiator 7
ppb1 at pci0 dev 17 function 0 "VMware Virtual PCI-PCI" rev 0x02
pci2 at ppb1 bus 2
vic0 at pci2 dev 0 function 0 "AMD 79c970 PCnet-PCI" rev 0x10: irq 9, address 00:0c:29:60:42:54
eap0 at pci2 dev 1 function 0 "Ensoniq AudioPCI97" rev 0x02: irq 10
ac97: codec id 0x43525913 (Cirrus Logic CS4297A rev 3)
audio0 at eap0
midi0 at eap0: <AudioPCI MIDI UART>
isa0 at piixpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
pcppi0 at isa0 port 0x61
midi1 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask e965 netmask eb65 ttymask fbff
mtrr: Pentium Pro MTRR support
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
#
Reply With Quote
  #6   (View Single Post)  
Old 1st April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

Besides that, I need run My SQL on my system too.
Reply With Quote
  #7   (View Single Post)  
Old 1st April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Quote:
Originally Posted by bsdnewbie999 View Post
I never touch /var/www before. Here's my dmesg...
Thank you. I now know:
  • You are running 4.4-release on i386 architecture, and without any of the errata patches, as patch#1 is a kernel patch.
  • You have 256 MB of RAM defined.
  • You are running with APM, and ACPI is disabled.
  • You are running the OS from within a VMWare virtual machine.
I don't see anything indicative of a problem, directly, but this information is helpful in two ways:
  1. Patch #4 is for httpd. It does not appear to directly apply, as it is related to mod_proxy, which is not enabled by default in /var/www/conf/httpd.conf. Examine the file, and confirm that mod_proxy is commented out. Please consider applying the patch, as well.
  2. 256MB may not be sufficient RAM, since you run X (both Fluxbox and KDE have been mentioned by you in other threads, if I recall correctly). If you run out of RAM and swap space, your OS will stop operating properly.
Question 5: What is the size of your swap space?

Hint: to answer this, see the output of:
$ swapctl -lk
Since this appears to be an httpd process hang, and not an OS hang, perhaps you can gather more diagnostic information:
Run top(1) from another console while httpd is started and inoperative. Filter for httpd, and examine any httpd processes shown. Is one or more CPU bound? If not, what is/are the process(es) waiting for?
Diagnostics may be obtained from tools like gdb(1), systrace(1), and ktrace(1), but you do not appear to have the applicable skills or knowledge required to deploy them. We are left with empirical examination using tools like top, systat(1), and vmstat(1).

Quote:
Originally Posted by bsdnewbie999 View Post
Besides that, I need run My SQL on my system too.
Please don't hijack your own thread, bsdnewbie. If you need assistance with MySQL:
  1. Research deployment and configuration of the database platform on your own, first.
  2. Install the packages required.
  3. Configure as you require for your application.
  4. If you get unanticipated results, research the cause as best you can.
  5. If you still need assistance, consider if your trouble is OS, database, or application related.
  6. If application related, post your question on the appropriate application support forum or mailing list.
  7. If database related, ask your question on the appropriate MySQL forum or mailing list.
  8. If OS related, bring your specific question here ... but in a new thread.

Last edited by jggimi; 1st April 2009 at 01:26 PM. Reason: two typos
Reply With Quote
  #8   (View Single Post)  
Old 1st April 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

jggimi, you are the man!
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #9   (View Single Post)  
Old 1st April 2009
johnzlly johnzlly is offline
Port Guard
 
Join Date: Jun 2008
Posts: 23
Default

Agree,Carpetsmoker.
Reply With Quote
Old 2nd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

I have downloaded the patch for httpd but i have problem patching it when i do
Code:
# patch -p0 < 004_httpd.patch                                                  
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Apply by doing:
|	cd /usr/src
|	patch -p0 < 004_httpd.patch
|
|And then rebuild and install httpd and its modules:
|	cd usr.sbin/httpd
|	make -f Makefile.bsd-wrapper obj
|	make -f Makefile.bsd-wrapper cleandir
|	make -f Makefile.bsd-wrapper depend
|	make -f Makefile.bsd-wrapper
|	make -f Makefile.bsd-wrapper install
|
|If httpd had been started, you might want to run
|	apachectl stop
|before running "make install", and
|	apachectl start
|afterwards.
|
|Index: usr.sbin/httpd/src/ap/ap_hook.c
|===================================================================
|RCS file: /cvs/src/usr.sbin/httpd/src/ap/ap_hook.c,v
|retrieving revision 1.6
|retrieving revision 1.6.14.1
|diff -u -p -r1.6 -r1.6.14.1
|--- usr.sbin/httpd/src/ap/ap_hook.c	15 Jun 2005 00:00:09 -0000	1.6
|+++ usr.sbin/httpd/src/ap/ap_hook.c	6 Nov 2008 10:06:50 -0000	1.6.14.1
--------------------------
File to patch:
something that confused me:
1. Maybe u think it is stupid quetion but i really don't know what is the File to patch? I have been google it and search in the openbsd faq and i found that there is a number of people don't know about this too besides I didn't found any answer for that..

2. For the File to patch, i tried to put in the httpd.patch file and it failed. So i guess there should be a file in the /usr/src directory but nothing is there..


jggimi,
Here is my swap space and I have set the RAM for OpenBSD virtual machine to 516RAM.

Code:
# swapctl -lk
Device      1K-blocks     Used    Avail Capacity  Priority
swap_device    313267        0   313267     0%    0
Reply With Quote
Old 2nd April 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Quote:
Originally Posted by bsdnewbie999 View Post
2. For the File to patch, i tried to put in the httpd.patch file and it failed. So i guess there should be a file in the /usr/src directory but nothing is there..
Still not reading the FAQ eh?

http://www.openbsd.org/faq/faq5.html#BldGetSrc

I'm starting to think this is some elaborate April 1st joke, nobody here is aware of the state of your system.. clearly you like tweaking/changing and testing things without first understanding the repercussions of doing so, you appear to have sufficient amounts of swap and RAM for a typical home server.

Possible problems? defective ram... configuration error... general user error we cannot remotely diagnose.

Sorry for the harshness, but.. it had to be said.
Reply With Quote
Old 2nd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

I know about cvs in updating the source tree. But I can also update using patches and the faq really didn't mention about the "File to patch:". It does confuse a totally new BSD guy like me.
Reply With Quote
Old 2nd April 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

If you read a little further on the page I linked to, you would have noticed that you can obtain the source from a local mirror..

The source is not installed into /usr/src by default, but it is distributed on both release CD-ROM's and the FTP/HTTP mirrors.. in your case... src.tar.gz is what you're looking for.

Also, that errata patch is only relevant on 64-bit architectures... as mentioned clearly on the 4.4 errata page.

Quote:
Originally Posted by http://www.openbsd.org/errata44.html#004_httpd
Fix httpd(8)'s mod_proxy module which is broken on 64-bit architectures. Due to the bug this will result in child processes crashing when utilizing proxy rules during an HTTP session.
I gave a short list of other possible causes above.. there is nothing we can do without a little more information from you.
Reply With Quote
Old 2nd April 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by bsdnewbie999 View Post
But I can also update using patches and the faq really didn't mention about the "File to patch:".
When confronted with confusion, go to the tools known to provide information.
  • What does the manpage for patch(1) state?
    Code:
    DESCRIPTION
         patch will take a patch file containing any of the four forms of differ-
         ence listing produced by the diff(1) program and apply those differences
         to an original file, producing a patched version.  If patchfile is omit-
         ted, or is a hyphen, the patch will be read from the standard input.
  • On the patches page:

    http://openbsd.org/errata44.html

    There is a link which points to a text page stating (& jggimi has already mentioned this...):
    Code:
    Apply by doing:
    	cd /usr/src
    	patch -p0 < 004_httpd.patch
  • More information on patching can be found in Section 10.15 of the FAQ:

    http://openbsd.org/faq/faq10.html#Patches
  • The remaining question is how did you obtain the patch file itself? The patches file, 4.4.tar.gz, can be found on the project's main ftp site at pub/OpenBSD/patches/4.4.tar.gz.
  • Quote:
    So i guess there should be a file in the /usr/src directory but nothing is there..
    /usr/src will only have source code present if you have correctly followed the instructions of Section 5.3.3 from the FAQ:

    http://openbsd.org/faq/faq5.html#BldGetSrc

    Source code is not installed by default during installation.
To become proficient & productive with OpenBSD, you need to learn to use the tools available which includes understanding the documentation. Guessing will only get you into trouble, & by now, you should be aware of this consequence.

Last edited by ocicat; 2nd April 2009 at 07:09 AM.
Reply With Quote
Old 2nd April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Quote:
Originally Posted by bsdnewbie999 View Post
I have downloaded the patch for httpd but i have problem patching it...So i guess there should be a file in the /usr/src directory but nothing is there..
  • OpenBSD is source-code maintained. The adminstrator is expected to know and understand this, and be capable of source code maintenance.
  • Source code is not included during any installation. The administrator -- this means you -- is expected to obtain this in a separate step, as outlined in FAQ 5.
Quote:
Maybe u think it is stupid quetion but i really don't know what is the File to patch?
If you had taken the time to read the patch, you would see it patches multiple files:
usr.sbin/httpd/src/ap/ap_hook.c
usr.sbin/httpd/src/modules/proxy/proxy_http.c
These files exist in the source code, which you must manually obtain and place in /usr/src, per FAQ 5.

Stupid question? No. But it is a question which highlights what appears to be a continual intentional ignorance. It appears to be a complete indifference or unwillingness to learn, to me. If so, I don't think this OS is a good one for you, as it requires a willingness to learn ... unless you have the willingness to hire professional adminstrative services instead.
Reply With Quote
Old 2nd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

Now i managed to apply the patch. But my httpd still hangs.
Reply With Quote
Old 2nd April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Above, I said:
Quote:
Originally Posted by jggimi View Post
  1. Patch #4 is for httpd. It does not appear to directly apply, as it is related to mod_proxy, which is not enabled by default in /var/www/conf/httpd.conf. Examine the file, and confirm that mod_proxy is commented out. Please consider applying the patch, as well.
It apparently did not fix your problem, as expected. But I'd also written:
Quote:
Since this appears to be an httpd process hang, and not an OS hang, perhaps you can gather more diagnostic information:
Run top(1) from another console while httpd is started and inoperative. Filter for httpd, and examine any httpd processes shown. Is one or more CPU bound? If not, what is/are the process(es) waiting for?
Diagnostics may be obtained from tools like gdb(1), systrace(1), and ktrace(1), but you do not appear to have the applicable skills or knowledge required to deploy them. We are left with empirical examination using tools like top, systat(1), and vmstat(1).

Last edited by jggimi; 2nd April 2009 at 12:54 PM.
Reply With Quote
Old 2nd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

I run top as i # /usr/sbin/apachectl start

Code:
 PID USERNAME PRI NICE  SIZE   RES STATE    WAIT      TIME    CPU COMMAND
31997 keongpo    2    0   16M   23M sleep    select    0:51  5.13% Xorg
26300 keongpo    2    0 4676K   16M sleep    poll      0:02  2.98% gnome-termin
21824 keongpo    2    0   26M   52M sleep    poll      0:30  0.88% firefox-bin  
20119 keongpo    2    0 2648K 5928K sleep    select    0:09  0.00% fluxbox
 8135 keongpo    2    0 4440K   16M sleep    poll      0:05  0.00% gnome-termin
17827 _pflogd    4    0  460K  296K sleep    bpf       0:02  0.00% pflogd
 5040 root       2    0 1072K 1456K sleep    select    0:00  0.00% sendmail
28044 keongpo    2    0 1232K 3336K sleep    poll      0:00  0.00% bonobo-activ
29284 keongpo    2    0 1288K 3240K sleep    poll      0:00  0.00% gconfd-2
17282 keongpo   18    0  476K  412K idle     pause     0:00  0.00% sh
15686 _syslogd   2    0  436K  660K sleep    poll      0:00  0.00% syslogd
20343 root       2    0 1156K 1840K sleep    poll      0:00  0.00% httpd
13122 keongpo   18    0  488K  400K idle     pause     0:00  0.00% sh
29958 root      28    0  420K 1284K onproc   -         0:00  0.00% top 
29593 root       2    0  680K  768K sleep    select    0:00  0.00% cron
 4441 keongpo    2    0  368K 1064K idle     netio     0:00  0.00% gnome-pty-h
I copy and paste the top process and i found that httpd is sleep but i don't know what does it means. After some waiting, the apache started and i tried localhost using firefox but nothing happen. So i do,

Code:
# apachectl status                                                             

                                   Not Found

   The requested URL /server-status was not found on this server.
and i tried top again, it shows
Code:
PID USERNAME PRI NICE  SIZE   RES STATE    WAIT      TIME    CPU COMMAND
29766 www        2    0 1344K 2188K sleep    select    0:00  0.00% httpd

Last edited by bsdnewbie999; 2nd April 2009 at 01:50 PM. Reason: add on
Reply With Quote
Old 2nd April 2009
johnzlly johnzlly is offline
Port Guard
 
Join Date: Jun 2008
Posts: 23
Default

It's normal.When there is someone connecting,it'll fork a child process to take the socket.
Reply With Quote
Old 2nd April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Usually, httpd runs as a pool of processes. It does not appear that the application has gotten that far, but you cannot be sure unless you follow my recommendation. I'll highlight it, once more, because you've missed it twice now.
Quote:
Originally Posted by jggimi View Post
...Run top(1) from another console while httpd is started and inoperative. Filter for httpd, and examine any httpd processes shown. Is one or more CPU bound? If not, what is/are the process(es) waiting for?
It is likely that this won't show anything of value, of course. But we will never know unless you try it and report.

Should you bother to read httpd(8), you will see that there are a few things you could try that would be easier than posting here.

Example: -X. Does it produce any console output? If there is an error, it might show here.
Example: -T/-t. Do both produce confirmation of a valid httpd.conf file?
Example; -V/-v. Do both produce valid output?

All this time, httpd just might have been reporting problems in /var/www/logs. It is possible that the reason for the hang is in /var/www/logs/error_log.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5.2.6 and Apache 1.3 dialeight OpenBSD Packages and Ports 1 15th June 2009 03:04 AM
Upgrade Apache 1.3 mod_ssl to Apache 2.2 beandip FreeBSD Ports and Packages 11 26th March 2009 09:12 PM
30 years of star wars tech TerryP Off-Topic 0 27th December 2008 06:35 AM
Sun Java System Web Server - Active Server Pages (yes ASP) hopla FreeBSD General 0 26th September 2008 08:22 AM
Few questions about server(openSSH, apache ,) latorion FreeBSD General 10 11th August 2008 06:59 PM


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick