# Apache22 port broken? (config files missing after installation)



## VincentV (Nov 2, 2013)

I have a fresh and clean default 9.2-RELEASE (amd64) system. After finishing the installation today, I only did these things:

Update to 9.2-RELEASE-p1:


```
# freebsd-update fetch
# freebsd-update install
```

Install the ports tree (because I disabled ports during installation):


```
# portsnap fetch
# portsnap extract
```

Install Apache 2.2.25:


```
# cd /usr/ports/apache22
# make config (options leave default)
# make install
```

Everything looks good with compiling Apache and dependencies, but I get some errors at the end of the installation:


```
â€¦.
â€¦.
â€¦.
===>  Installing for apache22-2.2.25
===>  Checking if www/apache22 already installed
===> Creating users and/or groups.
Using existing group 'www'.
Using existing user 'www'.
cp: /usr/local/etc/apache22/extra/httpd-autoindex.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-autoindex.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-autoindex.conf /usr/local/etc/apache22/extra/httpd-autoindex.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-dav.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-dav.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-dav.conf /usr/local/etc/apache22/extra/httpd-dav.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-default.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-default.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-default.conf /usr/local/etc/apache22/extra/httpd-default.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-info.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-info.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-info.conf /usr/local/etc/apache22/extra/httpd-info.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-languages.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-languages.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-languages.conf /usr/local/etc/apache22/extra/httpd-languages.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-manual.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-manual.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-manual.conf /usr/local/etc/apache22/extra/httpd-manual.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-mpm.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-mpm.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-mpm.conf /usr/local/etc/apache22/extra/httpd-mpm.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-multilang-errordoc.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-multilang-errordoc.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-multilang-errordoc.conf /usr/local/etc/apache22/extra/httpd-multilang-errordoc.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-ssl.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-ssl.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-ssl.conf /usr/local/etc/apache22/extra/httpd-ssl.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-userdir.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-userdir.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-userdir.conf /usr/local/etc/apache22/extra/httpd-userdir.conf' failed
cp: /usr/local/etc/apache22/extra/httpd-vhosts.conf: No such file or directory
pkg_add: command '[ -f /usr/local/etc/apache22/extra/httpd-vhosts.conf ] || cp /usr/local/share/examples/apache22/extra/httpd-vhosts.conf /usr/local/etc/apache22/extra/httpd-vhosts.conf' failed
/usr/local/share/examples/apache22/httpd.conf -> /usr/local/etc/apache22/httpd.conf

To run apache www server from startup, add apache22_enable="YES"
in your /etc/rc.conf. Extra options can be found in startup script.

Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
```

And of course, lots of config files missing in /usr/local/etc/apache22:


```
# ls -la /usr/local/etc/apache22
# ls -la /usr/local/etc/apache22/
total 100
drwxr-xr-x  3 root  wheel    512 Nov  2 19:06 .
drwxr-xr-x  7 root  wheel    512 Nov  2 19:06 ..
drwxr-xr-x  2 root  wheel    512 Nov  2 19:06 Includes
-rw-r--r--  1 root  wheel  16838 Nov  2 19:06 httpd.conf
-rw-r--r--  1 root  wheel  12958 Nov  2 19:06 magic
-rw-r--r--  1 root  wheel  53011 Nov  2 19:06 mime.types
```

The /usr/local/share/examples/apache22/extra directory exists, and contains all files.

At first, I thought the apache22 port was broken, but I did not find any complaint on mailing lists and forums (while the apache22 port is very popular). So, if this is the local problem, what am I doing wrong?


----------



## VincentV (Nov 3, 2013)

I informed the maintainer and he said staging with empty directories is only working with PKGNG, that's the problem. Workaround for old pkg_* tools: add the following lines at the top in pkg-plist.


```
@exec mkdir -p %D/%%ETCDIR%%/extra 2> /dev/null
@exec mkdir -p %D/%%ETCDIR%%/Includes 2> /dev/null || true
@exec mkdir -p %D/%%ETCDIR%%/envvars.d 2> /dev/null || true
```


----------



## pvoigt (Nov 3, 2013)

Yes, that's what I've observed in http://forums.freebsd.org/showthread.php?t=42879. I could not provide a solution. I was wondering that there was no feedback so I thought I might have messed something with my various installation/deinstallation attempts.


----------

