I have problem with removing apache2 under ubuntu. What I tried is:
sudo apt-get remove apache2
sudo apt-get purge apache2
unfortunatelly after any of upper commands, there are still files:
sudo find / -name "apache2"
/var/log/apache2
/var/lib/update-rc.d/apache2
/var/cache/apache2
/usr/share/doc/apache2.2-common/examples/apache2
/usr/share/apache2
/usr/lib/apache2
/usr/lib/apache2/mpm-event/apache2
/usr/lib/apache2/mpm-itk/apache2
/usr/lib/apache2/mpm-worker/apache2
/usr/lib/apache2/mpm-prefork/apache2
/usr/sbin/apache2
/run/apache2
/run/lock/apache2
/etc/init.d/apache2
/etc/apache2
/etc/cron.daily/apache2
/etc/default/apache2
/etc/logrotate.d/apache2
When i run sudo /etc/init.d/apache2 start
* Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
After typing localhost in browser it responds with:
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Could this files disturb new apache server installation? I've checked them all but nothing interresting found.
EDIT:
Upper output is after removal of the server. After removal of all files from sudo find / -name "apache2" I did install again sudo apt-get install apache2. sudo /etc/init.d/apache2 outputs with:
* Starting web server apache2 Segmentation fault
Action 'start' failed.
The Apache error log may have more information.
But error.log and access.log are empty.
Apache install:
sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-common
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/321 kB of archives.
After this operation, 1,240 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Is it normal that it asks only for 1,240 kB space ?
First stop apache:
sudo service apache2 stop
Then, remove apache2 packages and dependencies:
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge
If you manually modified or installed stuff, apt might not remove it. Check what's left:
whereis apache2
Have a look whats inside these directories, and if you're confident you want to trash it, manually remove the directories as below:
sudo rm -Rf /etc/apache2 /usr/lib/apache2 /usr/include/apache2
enter image description here
See the image of the error here
Remove apache2 from the Ubuntu
To remove totally from your localhost
1st check the current status using
service apache2 status
if it's active (running)
write next
sudo apt remove apache2*
Say yes using y
And have a nice day :)
Remove and install apache2 this way:
sudo apt-get purge apache2
sudo apt-get install apache2
Related
I hope everyone is doing well.
I have created a Rocky Linux container that includes PHP and Apache. I run the image with :8080 port open. Whenever I try to reach the web server from a web browser by going into localhost:8080 I get 503 Service Unavailable - The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. error. I couldn't figure what to do next. How can I solve this issue? Thanks!
This is my Dockerfile:
RUN dnf update -y
RUN dnf install httpd -y
RUN dnf install php -y
RUN dnf install procps -y
RUN dnf install net-tools -y
RUN dnf install findutils -y
RUN dnf install vim -y
RUN dnf install git -y
RUN mkdir /run/php-fpm
ADD index.php /var/www/html/
CMD apachectl -D FOREGROUND```
"On RHEL 8/Rocky Linux 8, [mod_php] has been Deprecated and PHP-FPM (FPM : FastCGI Process Manager) is configured by default."
Check to see if the php-fpm service is running. If its not by default (which it most likely is not) you can modify the Dockerfile to also start php-fpm
In your Dockerfile try something like:
CMD php-fpm -D; /usr/sbin/httpd -D FOREGROUND
I have an AWS server running a website with NGINX and PHP. I originally installed these using the following:
sudo yum install -y nginx php-fpm
The version of PHP that is installed is 5.3.29 which but I need at least 5.4 to run a payments plug-in. All the info online indicates a PHP upgrade actually involves a reinstall. So I ran the series of commands below to upgrade to 7.1 (based on various online postings):
sudo yum remove php* httpd*
sudo yum clean all
sudo yum update -y
sudo yum install php71
After the upgrade all php files on my site result in a 404. But html files work fine, so NGINX is running. The resulting install of php7.1 doesnt seem to run as a service. If I run service --status-all I see no mention of any PHP. There is now no *.sock file in the /var/run/ folder hierarchy for nginx to link to. There is no www.conf file for php so I cannot configure a sock file location. The tutorials online mention running php afterwards using sudo systemctl restart php7.1-fpm.service but systemctl is not a command and there seems to be no PHP service to run anyway.
Am I missing something here? I am at a loss what to do next. Can anybody offer some direction or indication as to what I have done wrong and how I can debug this?
FINALLY! Seems the instructions on virtually every site I have looked at did not work. What did work was the following:
sudo yum install php71-fpm
I dont understand the difference between php71 and php71-fpm but using the latter seems to install the service and other files I needed. Not everything on my site is working though, as I now need to track down the various php components that are needed. It seems that the various php modules have changed name in assorted ways. For example, php71-pdo exists but php71-mysql does not.
Change PHP version.
sudo yum-config-manager --enable epel
yum install dnf -y
yum install epel-release yum-utils -y
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
dnf install php74.x86_64
dnf clean metadata
dnf install php-cli php-pdo php-fpm php-json php-mysqlnd
dnf list installed php-cli php-pdo php-fpm php-json php-mysqlnd
which php
php -v
yum update
sudo systemctl restart httpd
I'm using windows 10 and have provisioned a Scotch Box VM using vagrant.
Everything was working fine up till yesterday, can't see through what I may have done or what could have been done to the system (maybe a windows 10 update?)
Thing is, I can start my VM normally, I can connect to it using ssh, and I can even run php artisan tinker and mess around with php (In that way, php is working).
But I can't see any of the websites that are in the public folder! The files still exist; Even if I type directly the IP address of the VM (http://192.168.33.10/)
Thinking that it may be a update I did to php 7 using this:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php-7.0
Remove PHP 5 and install PHP 7:
sudo apt-get update
sudo apt-get purge php5-fpm -y
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
sudo apt-get --purge autoremove -y
found here
I have tried doing a restart on apache, via command line, but it says its missing a php 5 library:
vagrant#scotchbox:~$ sudo service apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 141 of /etc/apache2/apache2.conf: Could not > open configuration file /etc/apache2/mods-enabled/php5.load: No such file > or directory
Action 'configtest' failed.
The Apache error log may have more information.
When I try to sudo apt-get install the missing library, it says that it was already installed and up to date, and can't find the log it says above.
I switched my environment, and everything works fine on linux (not inside vagrant, but running the source code directly with artisan serve)
All help apreciated!
If you remove the php5 modules, you should remove line 141 from your /etc/apache2/apache2.conf file, the line would be LoadModule ....
I was trying to install php5-gd but after ran this command:
yum install php-gd php-tidy
and tried to restart apache:
httpd -k restart
I got the following error:
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.modules.d/10-php.conf: Cannot load modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: symbol SSLeay_version, version OPENSSL_1.0.1 not defined in file libcrypto.so.10 with link time reference
Any of you knows why or how can I fix this error?
It could be because openSSL hasn't been updated. Could you try updating openSSL via yum and let us know if it works?
yum update openssl
The php you are trying to load is compiled with more recent version of openssl than you have installed. Most probably you have messed installation using repositories with different versions of openssl libs. Or else for different versions of OS.
yum list php-gd and yum list openssl rpm -qf /etc/httpd/modules/libphp5.so should give you a hint or two.
yum remove httpd
yum clean all
Step1: install fedora 19
Step2: install repository
rpm -Uvh http://rpms.famillecollet.com/remi-release-19.rpm
Step3: Install Apache (httpd) Web server and PHP 5.5.9
yum --enablerepo=remi install httpd php php-common
Step4: Install PHP 5.5.9 modules
yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
Step5: enable service and run it
systemctl enable httpd.service
/etc/init.d/httpd start ## use restart after update
OR
service httpd start ## use restart after update
Step 6: Create test PHP page to check that Apache, PHP and PHP modules are working
add test page to /var/www/html/test.php file and run using localhost/test.php
Just comment this libphp5.so file under error.conf file and try to restart the httpd server like:
/etc/init.d/httpd start
If again you are facing issue then check the certificate under the specific location where the .crt and .jks file exist.
Fedora 25:
sudo dnf -y remove httpd
sudo dnf -y install httpd
I would recommend having a backup of all files and configuration though, just in case.
On Centos 7
yum install -y php php-common
yum install openssl
or
yum reinstall openssl
systemctl restart httpd
Try run
sudo dnf install libnsl
I have installed phyMyAdmin on my Ubuntu 12.04 using sudo apt-get.. I configured the Apache2 Server as it was given in the Documentation The problem I am facing is that when i take "http://localhost/phyMyAdmin" nothing is displayed in the browser,instead it downloads a php file. Why is this occuring?How can I resolve this problem?
You're missing PHP.
From the terminal:
sudo apt-get install php5 php5-mysql
Then restart Apache:
sudo service apache2 restart
You can then navigate to http://localhost/phyMyAdmin and it'll work.
This might help you
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo service apache2 restart