# cannot ssh / apache



## hirohitosan (Feb 12, 2011)

Hi there. I tried to install Joomla on my server. I followed the instructions and I enabled AcceptFilter suport in FreeBSD kernel:

```
# echo apache22_http_accept_enable=\"YES\" >> /etc/rc.conf
```
Then I tried to manually load the module
[cmd=]# kldload accf_http[/cmd]

After that I reboot. That was not a good ideea. Since then I cannot log on my box 

I can ping my server but I cannot ssh.

Any suggestions?

thanks!


----------



## SIFE (Feb 13, 2011)

As I know to load a module at boot time you have to add it to /boot/loader.conf, so add yours like this:

```
accf_http_enable="YES"
```
You can't to SSH to your server because it isn't enabled yes, again to enable SSH, you have to add it to /etc/rc.conf like this:

```
openssh_enable="YES"
```



> After that I reboot. That was not a good ideea. Since then I cannot log on my box


And I don't think you can log in to your server any more until some one inside enable SSH functionality, mistakes happened , try to contact support.


----------



## DutchDaemon (Feb 13, 2011)

There's really not much that can be said about this. Are you sure you have 
	
	



```
sshd_enable="YES"
```
 in /etc/rc.conf? And using *kldload* will not *permanently* load the necessary module. You will need to add it to /boot/loader.conf, usually like this:


```
accf_data_load="YES"
accf_http_load="YES"
```

Maybe using 
	
	



```
apache22_http_accept_enable="YES"
```
 in /etc/rc.conf without actually loading the module in /boot/loader.conf screws up or halts the boot process.


----------



## hirohitosan (Feb 13, 2011)

Thank you. I add in /boot/loader.conf the lines that DutchDaemon suggested and restarted. Now I have sshd up and working but apache22 doesn't start 
	
	



```
/usr/local/etc/rc.d/apache22 start
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: <IfModule> directive requires additional arguments
Starting apache22.
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: <IfModule> directive requires additional arguments
/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22
```
I append following lines to other LoadModule lines in /usr/local/etc/apache22/httpd.conf to enable mod_fcgid: 
	
	



```
LoadModule fcgid_module libexec/apache22/mod_fcgid.so
<IfModule>
    AddHandler fcgid-script .fcgi
</IfModule>

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
```
Previously I installed /usr/ports/www/mod_fcgid and # pkg_add -r php5 after that
	
	



```
# php-cgi -v
PHP 5.3.2 with Suhosin-Patch (cgi-fcgi) (built: Jun 12 2010 00:11:09)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
# cd /usr/local/etc
# cp php.ini-production php.ini
```
I created a file named fcgid-php.conf in /usr/local/etc/apache22/Includes with the following lines:
	
	



```
<IfModule>
    # Cause the PHP interpreter to handle files with a .php extension.
    AddHandler fcgid-script .php
    AddType text/html .php    

    # Add index.php to the list of files that will be served as directory
    # indexes.
    DirectoryIndex index.php    

    # Where to look for the php.ini file?
    #DefaultInitEnv PHPRC        "/etc/php5/cgi"    

    # Maximum requests a process handles before it is terminated
    MaxRequestsPerProcess       1000    

    # Maximum number of PHP processes
    MaxProcessCount             10    

   # Number of seconds of idle time before a process is terminated
    IPCCommTimeout              240
    IdleTimeout                 240    

    # Command used to spawn FCGI server processes
    FCGIWrapper /usr/local/bin/php-cgi .php
</IfModule>
```
Create the file /usr/local/www/apache22/cgi-bin/phpinfo.php

```
<?php phpinfo(); ?>
```
After that I reboot and now apache doesn't start.

What was wrong?
Thanks!


----------



## DutchDaemon (Feb 13, 2011)

Do you have those 
	
	



```
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
```
 lines in there, just like that? They both need to be closed properly using </IfModule>, and some statements in between about what to do with those modules (actions). Comment both of the lines (as they are now) out and see what happens.

Note, the defaults in  extra/httpd-mpm.conf appear to be:


```
<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
LockFile "/var/log/accept.lock"
</IfModule>
</IfModule>
```


----------



## hirohitosan (Feb 13, 2011)

I comment out 
	
	



```
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
```
 and try to start apache but the same error 
	
	



```
# service apache22 start
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: <IfModule> directive requires additional arguments
Starting apache22.
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: <IfModule> directive requires additional arguments
```
the line 106 start with 
	
	



```
<IfModule>
    AddHandler fcgid-script .fcgi
</IfModule>
```
I found this suggestion here.


----------



## DutchDaemon (Feb 13, 2011)

Ah, I think the <IfModule> line actually needs the name of the Module in it  Probably something like <IfModule fcgid_module> (no idea, though there is a <IfModule cgid_module>).


----------



## hirohitosan (Feb 14, 2011)

many, many thanks!
It was that!
I added <IfModule fcgid_module> to /usr/local/etc/apache22/httpd.conf and /usr/local/etc/apache22/Includes/fcgid-php.conf and apache starts!


----------

