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 27th September 2015
adam adam is offline
New User
 
Join Date: Aug 2012
Posts: 4
Default httpd(8) and php-fpm no dynamic content

Hello.

Could someone please help me to set up httpd(8) and php-fpm?
  • $ dmesg
Code:
OpenBSD 5.8-current (GENERIC.MP) #1378: Thu Sep 24 20:47:17 MDT 2015
    deraadt@amd64.openbsd.org:/usr/src/s...ile/GENERIC.MP
real mem = 510156800 (486MB)
avail mem = 490647552 (467MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf0450 (73 entries)
bios0: vendor Dell Inc. version "A03" date 08/05/2005
bios0: Dell Inc. OptiPlex GX620
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC BOOT ASF! MCFG HPET
acpi0: wakeup devices VBTN(S4) PCI0(S5) PCI4(S5) PCI2(S5) PCI3(S5) PCI1(S5) PCI5(S5) PCI6(S5) MOU_(S3) USB0(S3) USB1(S3) USB2(S3) USB3(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Pentium(R) 4 CPU 2.80GHz, 2793.48 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,CNXT-ID,CX16,xTPR,NXE,LONG
cpu0: 1MB 64b/line 8-way L2 cache
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 199MHz
cpu0: mwait min=0, max=0 (bogus)
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Pentium(R) 4 CPU 2.80GHz, 2793.00 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,CNXT-ID,CX16,xTPR,NXE,LONG
cpu1: 1MB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 8
acpimcfg0 at acpi0 addr 0xf0000000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 4 (PCI4)
acpiprt1 at acpi0: bus 2 (PCI2)
acpiprt2 at acpi0: bus 3 (PCI3)
acpiprt3 at acpi0: bus 1 (PCI1)
acpiprt4 at acpi0: bus -1 (PCI5)
acpiprt5 at acpi0: bus -1 (PCI6)
acpiprt6 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
acpibtn0 at acpi0: VBTN
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82945G Host" rev 0x02
ppb0 at pci0 dev 1 function 0 "Intel 82945G PCIE" rev 0x02: msi
pci1 at ppb0 bus 1
vga1 at pci0 dev 2 function 0 "Intel 82945G Video" rev 0x02
intagp0 at vga1
agp0 at intagp0: aperture at 0xe0000000, size 0x10000000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: apic 8 int 16, 1280x1024
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 82945G Video" rev 0x02 at pci0 dev 2 function 1 not configured
ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: msi
pci2 at ppb1 bus 2
bge0 at pci2 dev 0 function 0 "Broadcom BCM5751" rev 0x01, BCM5750 A1 (0x4001): apic 8 int 16, address 00:12:3f:53:d0:ca
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x01: msi
pci3 at ppb2 bus 3
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 8 int 21
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 8 int 22
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 8 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 8 int 23
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 8 int 21
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xe1
pci4 at ppb3 bus 4
auich0 at pci0 dev 30 function 2 "Intel 82801GB AC97" rev 0x01: apic 8 int 23, ICH7 AC97
ac97: codec id 0x41445374 (Analog Devices AD1981B)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
pcib0 at pci0 dev 31 function 0 "Intel 82801GB LPC" rev 0x01
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x01: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 ignored (disabled)
pciide0: channel 1 ignored (disabled)
pciide1 at pci0 dev 31 function 2 "Intel 82801GB SATA" rev 0x01: DMA, channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 8 int 20 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <ST3250310CS>
wd0: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 6
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x01: SMI
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 512MB DDR2 SDRAM non-parity PC2-4200CL5
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
rum0 at uhub0 port 1 configuration 1 interface 0 "Ralink 802.11 bg WLAN" rev 2.00/0.01 addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:24:01:60:db:b8
uhidev0 at uhub1 port 2 configuration 1 interface 0 "CHICONY HP Basic USB Keyboard" rev 1.10/3.00 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (b0fdfdb6049106bb.a) swap on wd0b dump on wd0b
  • $ cat /etc/httpd.conf
Code:
# $OpenBSD: httpd.conf,v 1.14 2015/02/04 08:39:35 florian Exp $

#
# Macros
#
ext_addr="*"

#
# Global Options
#
# prefork 3

#
# Servers
#

# A minimal default server
server "default" {
        listen on $ext_addr port 80
        root "/htdocs/www"

        # Logging is enabled by default, but it can be turned off per server
        #no log

        location "/*" {
                directory auto index
#               directory { index index.php index.html }
                log style combined
        }

        location "*.php$" {
                fastcgi socket "run/php-fpm.sock"
        }
}

# Include MIME types instead of the built-in ones
types {
        include "/usr/share/misc/mime.types"
}
  • $ grep -e "^[^;]" /etc/php-fpm.conf # file is quite big...show me what's important
Code:
[global]


[www]
listen.owner = www
listen.group = www
listen.mode = 0660
user = www
listen = /var/www/run/php-fpm.sock

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3








chroot = /var/www
  • $ tail /var/log/php-fpm.log
Code:
[27-Sep-2015 15:13:37] NOTICE: Terminating ...
[27-Sep-2015 15:13:37] NOTICE: exiting, bye-bye!
[27-Sep-2015 15:13:38] NOTICE: fpm is running, pid 20304
[27-Sep-2015 15:13:38] NOTICE: ready to handle connections
[27-Sep-2015 15:25:52] NOTICE: Terminating ...
[27-Sep-2015 15:25:52] NOTICE: exiting, bye-bye!
[27-Sep-2015 15:25:53] ERROR: FPM initialization failed
[27-Sep-2015 15:26:25] NOTICE: fpm is running, pid 19341
[27-Sep-2015 15:26:25] NOTICE: ready to handle connections
What else could I provide to help? Thank you all for help in advance

Last edited by ocicat; 27th September 2015 at 06:03 PM. Reason: Please use [code] & [/code] tags when posting console output.
Reply With Quote
  #2   (View Single Post)  
Old 27th September 2015
Scarletts
-Guest-
 
Posts: n/a
Default

The first problem that I notice is that the location directive doesn't support regex. Remove the $ symbol.

"/htdocs/www" also doesn't seem right. Did you mean to use the default directory? If so, it should be "/htdocs".

The default php-fpm config will be fine. I'd leave it alone.
Reply With Quote
  #3   (View Single Post)  
Old 27th September 2015
adam adam is offline
New User
 
Join Date: Aug 2012
Posts: 4
Default

Quote:
Originally Posted by Scarletts View Post
The first problem that I notice is that the location directive doesn't support regex. Remove the $ symbol.

"/htdocs/www" also doesn't seem right. Did you mean to use the default directory? If so, it should be "/htdocs".

The default php-fpm config will be fine. I'd leave it alone.
Thank you. I removed the $ sign. Thanks for that.

Code:
$ cat /etc/httpd.conf
# $OpenBSD: httpd.conf,v 1.14 2015/02/04 08:39:35 florian Exp $

#
# Macros
#
ext_addr="*"

#
# Global Options
#
# prefork 3

#
# Servers
#

# A minimal default server
server "default" {
        listen on $ext_addr port 80
        root "/htdocs"

        # Logging is enabled by default, but it can be turned off per server
        #no log

        location "/*" {
                directory auto index
#               directory { index index.php index.html }
                log style combined
        }

        location "*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

# Include MIME types instead of the built-in ones
types {
        include "/usr/share/misc/mime.types"
}
The /var/www/htdocs/www/ is subfolder I created. It should not make any difference.

Unfortunately still it does not work for me.

I do not see any errors in my logs.
Reply With Quote
  #4   (View Single Post)  
Old 27th September 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Adam, this thread has some working examples which may help you.

http://daemonforums.org/showthread.php?t=8965
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
pf by content? phyro OpenBSD Security 2 7th February 2013 09:40 AM
Content Filtering with OpenBSD alpha202ej OpenBSD Security 4 21st December 2011 01:38 PM
block illegal content wesley OpenBSD Security 1 25th December 2010 05:31 PM
Web content filtering Crypt FreeBSD Security 14 14th December 2008 02:38 PM


All times are GMT. The time now is 05:17 PM.


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