LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 09-16-2012, 08:52 AM   #1
sasser
Member
 
Registered: Apr 2010
Location: Bucharest
Distribution: Slackware13.37, OpenBSD5.1, FreeBSD9.0
Posts: 39

Rep: Reputation: 0
openbsd 5.1 apply patch for mod_userdir


Hello

The userdir support was accidentally left out of httpd in OpenBSD 5.1 release. I need that support so I try to apply the fix patch (userdir.patch).
Seaching the Internet I found something called userdir.patch on OpenBSD website:
http://ftp.openbsd.org/pub/OpenBSD/p.../userdir.patch
I did read the FAQ about installing patches but I still couldn't figure out how to do it

In userdir.patch there is a section describing the steps to do it:
Code:
Apply by doing
	cd /usr/src/usr.sbin/httpd/src
	patch -p0 < userdir.patch

And then rebuild httpd by doing
	cd /usr/src/usr.sbin/httpd
	make clean && make && make install
The problem is that I don't have that path. My /usr/src directory is empty.
Why? What can I do?
I'm new to OpenBSD and I haven't applied any patch yet, maybe I'm doing something wrong?

I spent a hole week to figure out why the userdir doesn't work reading tens of tutorials and forums, just to find that the OpenBSD team forgot to add it and now, I found the solution but I can't use it. It's very frustraing.
 
Old 09-16-2012, 09:19 AM   #2
ocicat
Member
 
Registered: May 2007
Posts: 207

Rep: Reputation: 46
Quote:
Originally Posted by sasser View Post
The problem is that I don't have that path. My /usr/src directory is empty.
Correct. By default, the installation of OpenBSD does not include installing source code. This is discussed in Section 5.3.3 of the FAQ. Assuming you installed 5.1-release, go to a mirror site & download the files:
  • src.tar.gz
  • sys.tar.gz
...& ensure you get these files for 5.1-release. Further instructions on installation can be found in the appropriate portion of Section 5.3.3.
 
Old 09-16-2012, 12:27 PM   #3
sasser
Member
 
Registered: Apr 2010
Location: Bucharest
Distribution: Slackware13.37, OpenBSD5.1, FreeBSD9.0
Posts: 39

Original Poster
Rep: Reputation: 0
Thanks for your quick answer ocicat.

I followed your guidance and downloaded those two files from
http://ftp5.eu.openbsd.org/ftp/pub/OpenBSD/5.1/
and extract them to /usr/src

Then I downloaded the userdir.patch
http://ftp5.eu.openbsd.org/ftp/pub/O.../userdir.patch

Next, move the userdir.patch to /usr/src/usr.sbin/httpd/src, and:
Code:
# cd /usr/src/usr.sbin/httpd/src
# patch -p0 < userdir.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Note: this is the third version of this patch.
|
|Apply by doing
|       cd /usr/src/usr.sbin/httpd/src
|       patch -p0 < userdir.patch
|
|And then rebuild httpd by doing
|       cd /usr/src/usr.sbin/httpd
|       make clean && make && make install
|
|Index: Configuration
|===================================================================
|RCS file: /cvs/src/usr.sbin/httpd/src/Configuration,v
|retrieving revision 1.2
|retrieving revision 1.3
|diff -u -r1.2 -r1.3
|--- Configuration      1998/10/01 17:29:04     1.2
|+++ Configuration      1998/11/15 00:14:32     1.3
--------------------------
Patching file Configuration using Plan A...
Hunk #1 succeeded at 335 with fuzz 2 (offset 47 lines).
done
# cd /usr/src/usr.sbin/httpd/
# make clean && make && make install
make: don't know how to make clean. Stop in /usr/src/usr.sbin/httpd.
#
What's wrong?
 
Old 09-16-2012, 06:29 PM   #4
ocicat
Member
 
Registered: May 2007
Posts: 207

Rep: Reputation: 46
Quote:
Originally Posted by sasser View Post
Code:
# make clean && make && make install
make: don't know how to make clean. Stop in /usr/src/usr.sbin/httpd.
#
What's wrong?
I have one observation & one guess.

First, since you have just downloaded & installed the source code, executing the clean target is not especially important in this singular case, however, this doesn't answer the question about what is amiss.

My guess is that either the path or permissions are wrong, & I lean towards the latter. The instructions in Section 5.3.3 preface each command with a '#' hash symbol which is shorthand for indicating that these commands are to be executed either as root or via sudo(8). I suspect these commands were not executed as root, & this is the reason why you are unable to build.
 
Old 09-17-2012, 11:47 AM   #5
sasser
Member
 
Registered: Apr 2010
Location: Bucharest
Distribution: Slackware13.37, OpenBSD5.1, FreeBSD9.0
Posts: 39

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ocicat View Post
I suspect these commands were not executed as root, & this is the reason why you are unable to build.
I was root when running those commands (logged in as a different user, the use su command to become root), the code block from my previous post was captured from putty terminal, you can see the distinctive sign for root: "#"
The patch seems to be applied OK since the exit message is:
Patching file Configuration using Plan A...
Hunk #1 succeeded at 335 with fuzz 2 (offset 47 lines).
done


I did install a fresh copy of OpenBSD 5.1 on another machine, defined no other user, logged in as root and apply the patch, I get the same answer. Something else should be wrong, I don't think the permissions.
 
Old 09-17-2012, 12:30 PM   #6
sasser
Member
 
Registered: Apr 2010
Location: Bucharest
Distribution: Slackware13.37, OpenBSD5.1, FreeBSD9.0
Posts: 39

Original Poster
Rep: Reputation: 0
Looking in the directory where I supposed to run make there was no Makefile, just Makefile.bsd-wrapper and Makefile.tmpl
I did:
Code:
# make -f Makefile.bsd-wrapper
and something happened.. I don't know what, but the result was a new file appeared: Makefile

Then I followed the steps to do from userdir.patch:
Code:
# cd /usr/src/usr.sbin/httpd
# make clean && make && make install
The rebuild started and finished with the message:
Code:
+--------------------------------------------------------+
| You now have successfully built and installed the      |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the         |
| (initially created or preserved) configuration files   |
|                                                        |
|   /var/www/conf/httpd.conf
|                                                        |
| and then you should be able to immediately fire up     |
| Apache the first time by running:                      |
|                                                        |
|   /usr/sbin/apachectl start
|                                                        |
| Or when you want to run it with SSL enabled use:       |
|                                                        |
|   /usr/sbin/apachectl startssl
|                                                        |
| Thanks for using Apache.       The Apache Group        |
|                                http://www.apache.org/  |
+--------------------------------------------------------+
I've opened the /var/www/conf/httpd.conf file but seems unchanged nothing new for userdir. Searched my system for mod_userdir.so.. nothing

Started Apache:
Code:
# apachectl start
/usr/sbin/apachectl start: httpd started
Go to my user page: localhost/~paul
And the same answer.. couldn't find it.
Looking in the error_log, the Apache still look in htdocs for that directory instead in /home/paul/public_html:
Code:
[Mon Sep 17 20:02:37 2012] [error] [client 127.0.0.1] File does not exist: /htdocs/~paul
[Mon Sep 17 20:21:59 2012] [error] [client 192.168.2.20] File does not exist: /htdocs/~paul/index.html
It doesn't work either I try from server itself issuing localhost/~paul or from an external machine.
There is a file called index.html inside that directory.
The permissions to public_html are 755 and for index.html are 644 so the user www should be able to traverse the directory structure and get that file.
The UserDir configuration in httpd.conf is:
Code:
 429 UserDir "public_html"
 430 UserDir disabled
 431 UserDir enabled paul
....
451 <Directory "/home/*/public_html">
 452     AllowOverride FileInfo AuthConfig Limit
 453     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
 454     <Limit GET POST OPTIONS PROPFIND>
 455         Order allow,deny
 456         Allow from all
 457     </Limit>
 458     <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
 459         Order deny,allow
 460         Deny from all
 461     </Limit>
 462 </Directory>
What I wrong? What can I done more? Is it correctly what I've done? Even mentioning that at least one part from the configuration is correct is a great help. I'm new to OpenBSD and I'm unsure about many things about it
Thanks for reading..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apply Patch culin Linux - General 1 02-21-2007 08:02 AM
how to apply a patch? ashlesha Linux - Software 4 12-07-2006 02:09 PM
How to apply a patch? amwink Programming 2 11-25-2005 07:14 PM
Ho Do I Apply The CK Patch? AFI_Flame Linux - Software 1 11-14-2004 10:49 PM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM


All times are GMT -5. The time now is 11:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration