Ubuntu. Disable open_basedir and safemode - ubuntu-10.04

I am running an Ubuntu 10.04 VPS server with PHP 5.3.
I got an error saying that curl does not work with safe mode and open_basedir activated
Severity: Warning
Message: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set
Filename: libraries/Curl.php
Line Number: 213
How can I disable safe mode and open_basedir?
Thankful for all help!

Just comment out the open_basedir line in php.ini, you'll probably find it here:
/etc/php5/apache2/php.ini
Then restart Apache:
sudo /usr/sbin/apache2ctl restart
You probably also want to read about the implications of turning this off.

Related

Installing Apache on Windows Subsystem for Linux

Having just updated to the newest Windows 10 release (build 14316), I immediately started playing with WSL, the Windows Subsystem for Linux, which is supposed to run an Ubuntu installation on Windows.
Maybe I'm trying the impossible by trying to install Apache on it, but then someone please explain me why this won't be possible.
At any rate, during installation (sudo apt-get install apache2), I received the following error messages after the dependencies were downloaded and installed correctly:
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: No such file or directory
runlevel:/var/run/utmp: No such file or directory
* Starting web server apache2 *
* The apache2 configtest failed.
Output of config test was:
mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
chmod: missing operand after '755'
Try 'chmod --help' for more information.
invoke-rc.d: initscript apache2, action "start" failed.
Setting up ssl-cert (1.0.33) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
WARN: / is group writable!
Now, I understand that there seem to be some folders and files missing for Apache2 to work. Before I start changing anything that will mess with my Windows installation, I want to ask whether there's a different way? Also, should I worry about / being group writable or is this just standard Windows behaviour?
In order to eliminate this warning
Invalid argument: AH00076: Failed to enable APR_TCP_DEFER_ACCEP
Add this to the end of /etc/apache2/apache2.conf
AcceptFilter http none
Note the following in your output
failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file
I tried listing /var/lock. It points to /run/lock, which doesn't exist.
Create the directory with
mkdir -p /run/lock
The install should now work (you may need to clean the installation first)
You have to start bash.exe in administrator mode to avoid a lot of problems related to network.
i installed Lamp (Apache/MySQL/Php) without any problem :
Start bash.exe in administrator mode
type : sudo apt-get install lamp-server^
add these 2 lines in /etc/apache2/apache2.conf :
Servername localhost
AcceptFilter http none
then you can start apache :
/etc/init.d/apache2 start
Following the great advice here I edited apache2.conf and inserted the following to end of file after receiving all the various errors above and apache2 then worked great on the debian wsl package:
Servername localhost
AcceptFilter http none
AcceptFilter https none

Apache2 Won't Start

I have set up ubuntu server on an old pc with webmin as well. I am not sure what was going on but i restarted the server and when it boots it now get this when Apache tries to start.
* Starting web server apache2
apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/000-default: No such file or directory
Action 'start' failed.
The Apache error log may have more information.
I have checked this file on this line and it looks like this:
# Include the virtual host configurations:
Include sites-enabled/
I have removed Apache and re installed it but not sure why it still fails.
As also answered by Qben, the issue was an invalid symlink in the sites-enabled folder. Removing the broken symlink and adding a valid one will fix the issue.
You do not have a default site enabled:
/etc/apache2/sites-enabled/000-default: No such file or directory
site-enabled should contain symlinks to files in site-available and I guess your 000-default symlink does not link to a real file in site-available.
I guess this Ubuntu guide might be of interest for you.
One of the reason may be that you might have some site that is not enabled.To check that
Go to /etc/apache2/sites-enabled
Out of many/some [sitename].conf files , one/some may be crossed
Delete those found crossed
Restart apache server
sudo service apache2 restart.
Hope this has helped you , but may be some other reason too. Thank you.

Magento 1.7 Installation Error in DreamHost shared hosting

Error in the Logs is
Premature end of script headers: index.php, referer: http://www.example.com/index.php/install/wizard/config/?config%5Blocale%5D=en_US&config%5Btimezone%5D=America%2FLos_Angeles&config%5Bcurrency%5D=USD
Error shown in magento installation screen
Error log record number: 425991650051
Also i found that during installation only 86 tables were sucessfully added in the magento database.
phpinfo of the Server
display_errors On
max_execution_time 30
memory_limit 90M
safe_mode Off
cURL support enabled
PDO support enabled
Simplexml support enabled
mcrypt support enabled
hash support enabled
GD Support enabled
DOM/XML enabled
iconv support enabled
Soap Client enabled
Soap Server enabled
Mysql Server version: 5.1.56
PHP Version 5.3.13
Changes made in index.php
error_reporting(E_ALL);
ini_set('display_errors', 1);
Initially i thought it was due to memory_limit and max_execution_time, but i recreated this same scenario in my localhost and it worked sucessfully inspite of memory being limited to 90M and max exec time as 30
How to solve this issue?
have you try this
change the permissions on index.php to 644.
also changed the directories permission: app, var, media and app/etc to 755

Redmine RailsBaseURI

I installed Redmine with this How-To
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_using_Debian_package
ln -s /usr/share/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
/etc/init.d/apache2 reload
/etc/init.d/apache2 restart
But I get following message restarting apache2.
Syntax error on line 1 of /etc/apache2/sites-enabled/redmine:
Invalid command 'RailsBaseURI', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
Best wishes
Partial solved with #favoretti 's advice:
#apt-get install libapache2-mod-passenger
#/etc/init.d/apache2 reload
Reloading web server config: apache2.
Means the errors are gone
I arrived due to googling "Invalid command 'RailsBaseURI'. There wasn't an answer for me here, but I later realized that this error was being caused by passenger not being enabled.
Assuming you have already installed it, you can enable passenger with sudo a2enmod passenger.
You should check passenger configure.
1.whether link passenger.conf and passenger.load in /etc/apache2/mods-enabled
/etc/apache2/mods-enabled# ls passenger.*
passenger.conf
passenger.load
2.check your configure files: passenger.conf/passenger.load
passenger.conf:
<IfModule mod_passenger.c>
PassengerRoot /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14
PassengerDefaultRuby /home/hao/.rvm/wrappers/ruby-1.9.3-p448#rails4.0/ruby
</IfModule>
passenger.load:
LoadModule passenger_module /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14/buildout/apache2/mod_passenger.so
3.whether passenger is runnig, according to official doc
Restart your web server and run:
passenger-memory-stats

Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration failed

When I try to start or restart my apache server, I get bellow message:
Syntax error on line 162 of /etc/apache2/apache2.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
and I tried find this error on google and fix it:
http://linuxindetails.wordpress.com/2009/12/02/invalid-command-order-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-configuration-failed/
I get error:
Module authz_host does not exist!
So, some body help me to fix it?
I just had the same problem while upgrading from openSUSE 13.2 to openSUSE Leap 42.1.
The problem is not a missing module in the apache2-configuration.
The problem is the upgrade from apache 2.2 to apache 2.4.
"Order" and "Allow" have to be rewritten as follows (example):
in 2.2:
Order allow,deny
Allow from all
in 2.4:
Require all granted
You can find more options an examples here:
Upgrading apache2
With Apache 2.4 please uncomment/add the following modules:
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_host_module modules/mod_authz_host.so
On SUSE 12, authz_host was already enabled, so I needed to follow willoller's comment and enable mod_access_compat:
a2enmod mod_access_compat
service apache2 restart
You need to enable the authz_host module. Here is the Apache documentation on that module.
I'm not sure what Linux distribution you are using but here are some examples.
Ubuntu:
sudo a2enmod authz_host
sudo service apache2 restart
RHEL:
vi /etc/httpd/conf/httpd.conf
# Make sure this line is not commented:
...
LoadModule authz_host_module modules/mod_authz_host.so
...
If you are running Apache2.4 on Gentoo then make sure you enable the following USE flags that will build the mod_authz_host into apache binary:
apache2_modules_authz_host : Group authorizations based on host (name or IP address)
apache2_modules_access_compat : Group authorizations based on host (name or IP address). Available as a compatibility module with previous versions.
If you are compiling the Apache2.4 from source code then you can follow the same guidance by using the build-time configuration options (complete list here).

Resources