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 26th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default httpd web server not read my files

Hi,
I am trying to have a little web server onto OpenBSD 5.7, running on VMware.
I followed this tutorial but I noticed that it is very old! From 5.6 version, in fact, there is a new httpd server as I understand it.
One of the issues I am having is to install mysql-server: this packet does not seems to exists!
After, I configured /var/www/conf/http.conf in this way:
Quote:
#DirectoryIndex index.php index.html
ext_addr="*"

server "default" {
listen on $ext_addr port 80
root "/htdocs"
}
but it does not properly works.
If I type links MY_IP it prints It works instead of the content of index.html file I put in /var/www/htdocs.
Why?
Is there a tutorial to correctly install a web server?
Thanks.
Reply With Quote
  #2   (View Single Post)  
Old 26th October 2015
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

Have you read the man pages for httpd(8) and httpd.conf(5) and looked at the example config in /etc/examples/ ?

The base httpd config file goes in /etc/, not in /var/www

Give that a try and see if you make it further.

Tim.
Reply With Quote
  #3   (View Single Post)  
Old 26th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default

Yes, I read the httpd.conf example before to make any changes.
Now, I copied /var/www/conf/httpd.conf in /etc/ but if I typed links MY_IP I have a connection refused error.
Reply With Quote
  #4   (View Single Post)  
Old 26th October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

The httpd(8) daemon must be running. For 5.7, you can use the rcctl(8) command to set the httpd as a daemon at boot time, and start it (so no reboot is needed).
Code:
# rcctl enable httpd
# rcctl start httpd

Last edited by jggimi; 26th October 2015 at 02:29 PM. Reason: typos. continually typos.
Reply With Quote
  #5   (View Single Post)  
Old 26th October 2015
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

Try connecting to 127.0.0.1, if that works what is your firewall configuration?

Tim.
Reply With Quote
  #6   (View Single Post)  
Old 27th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default

Quote:
Originally Posted by jggimi View Post
The httpd(8) daemon must be running. For 5.7, you can use the rcctl(8) command to set the httpd as a daemon at boot time, and start it (so no reboot is needed).
Code:
# rcctl enable httpd
# rcctl start httpd
Well! It works! Thank you very much

Edit 1: Another question: why OpenBSD does not find mysql-server? Is there another way to have php and mysql? I only install php-mysql packet

Edit 2: If I try to open a php file in links or graphical browser I cannot view the file but the browser give me only the possibility to download the file.

Last edited by tab; 27th October 2015 at 10:15 AM. Reason: added info
Reply With Quote
  #7   (View Single Post)  
Old 27th October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I believe you are looking for MariaDB. https://en.wikipedia.org/wiki/MariaDB

After installing mariadb-server:
  • The daemon to enable with rcctl(8) is called "mysqld".
  • Be sure to review the README file, which will be located in /usr/local/share/doc/pkg-readmes/.
Reply With Quote
  #8   (View Single Post)  
Old 27th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default

Is it compatible with some CMS such as Wordpress?

Quote:
Originally Posted by tab
If I try to open a php file in links or graphical browser I cannot view the file but the browser give me only the possibility to download the file.
How can I solve this issue?
Thanks
Reply With Quote
  #9   (View Single Post)  
Old 27th October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by tab View Post
Is it compatible with some CMS such as Wordpress?
I don't use either Wordpress or MariaDB, but the very first hit on a Google search using those two words was this link, which says:
Quote:
... because MariaDB is designed as a binary drop-in replacement of the original MySQL, you can replace MySQL with MariaDB for your WordPress installation and take advantage of its better performance...
You should find Google will be faster (and better) than asking this type of question here.
Quote:
How can I solve this issue?
PHP is typically utilized with httpd via the PHP FastCGI Process Manager: php-fpm. There is an example httpd.conf configuration on page 8 of this paper, and there are examples right here on this forum.

Last edited by jggimi; 27th October 2015 at 11:05 AM. Reason: corrected mariadb wordpress link
Reply With Quote
Old 27th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default

I had already read the official paper. I also read your link (and your post) but I have a 500 Internal Server Error.
I do not have php-fpm.sock under /var/www/run or /var/run.
So, I tried to install php-fpm with pkg_add -v but the problem is the same.
Reply With Quote
Old 27th October 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

You must start the php-fpm daemon. You may use rcctl(8) as previously discussed.

Edited to add:

The php-fpm daemon at 5.7 is named "php_fpm" -- note the underscore character.

Last edited by jggimi; 27th October 2015 at 12:18 PM. Reason: added daemon name
Reply With Quote
Old 27th October 2015
tab tab is offline
Port Guard
 
Join Date: Oct 2015
Posts: 15
Default

ok, thank you very very much!
Now, all works!
Reply With Quote
Reply

Tags
httpd

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
mdoc(7) documentation/ tutorial J65nko News 0 29th August 2011 02:00 AM
Tutorial for installing Gnome 2.28.2 on OpenBSD 4.7 jcdenton OpenBSD Packages and Ports 7 26th April 2011 05:24 AM
openBSD webserver tutorial werwer OpenBSD Packages and Ports 2 29th May 2010 04:20 PM
good vi(1) tutorial ocicat General software and network 4 8th April 2010 04:12 AM
Java online tutorial 18Googol2 Programming 5 28th August 2008 03:07 AM


All times are GMT. The time now is 04:33 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