LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2021, 03:45 PM   #1
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Rep: Reputation: Disabled
No permissions for /svr/www/htdocs and /etc/apache2/mod_mime-defaults.conf


Beginner: Today completed fresh install of Gecko Static KDE Plasma current.
All updates via "language installer" shortcut.
Yast to get another browser, KeePass, Bluefish.
Followed OpenSuse Wiki SDB:LAMP tutorial ... https://en.opensuse.org/SDB:LAMP_setup
Apache2, MariDB and PHP all installed via "zypper" as root.
All the above seemed to go exactly as described without issue.

But from SDB:LAMP could not do the following ...
Quote:
To check if you apache server works, use you favorite text editor "as root" and create an index.html file in the /srv/www/htdocs/ folder with the following content:
<html><body><h1>Welcome to my web site!</h1></body></html>
... and ...
Quote:
In addition, ensure that in `/etc/apache2/mod_mime-defaults.conf` there is a line
AddType application/x-httpd-php .php
I was unable to save or edit files in these locations.
Looked for a way to run Kate as root but it appears this is no longer supported.

Tried with Bluefish and still get permission denied.

The Gecko install was default (ie my password is also admin) and no messing with any settings related to the system and only used terminal for the listed operations.

I am aware that a virtual environment is advised for further progress but I am trying to follow the "official" tutorial ... but it offers no help to get the "as root" required.

I am not enabling public access.
I intend to run the "mysql_secure_installation" as soon as I can complete the previous sections.
 
Old 05-31-2021, 04:51 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,553

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Log in to a terminal as root and cd to that location: cd /srv/www/htdocs
then create the file with: touch index.html

You can use text editors like vi or nano from a terminal to edit the files, whichever you are familiar with.
 
Old 06-01-2021, 01:17 AM   #3
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you - yancek.
Success with first bit.
Followed your advice and got Nano to create the file ... after a few attempts as I have never used Nano before.
Apache test to localhost now working.

But I have a couple of previous fails in "htdocs" which are appended by ".save" and have a padlock icon overlay.
Cannot delete them.

Am I now restricted to using Nano and unable to use Bluefish (or other GUI editor) ?

Want to do the php next and really dont want to mess up this bit ...
/etc/apache2/mod_mime-defaults.conf
#Comment to note my addition to this file
AddType application/x-httpd-php .php

Not confident with Nano !

EDIT:
Found "File Manager as super user" ... and realised this allowed me to delete the two wronguns.
So will try the same trick with Bluefish ....
Cannot create a new file with Bluefish ... only edit one created by "touch filename.suffix"
But ... now as far as getting php index in browser ... so progress.
Thanks again.

Last edited by pavllvap; 06-01-2021 at 01:43 AM. Reason: Progress...
 
Old 06-01-2021, 02:39 AM   #4
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Following OpenSuse Wiki for LAMP install to Gecko Static Plasma.
And with help also from this forum ...
Have got to "mysql_secure_installation" but found the first stages different to the wiki.
Think I made a mistake and accepted the "advice" from MariaDB to do the following ...
Quote:
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n
... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] n
... skipping.
Remaining lines as per Wiki and got to end with ...
Quote:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'pmaUser'@localhost;
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> SELECT User, password FROM mysql.user;
+-------------+-------------------------------------------+
| User | Password |
+-------------+-------------------------------------------+
| mariadb.sys | |
| root | invalid |
| mysql | invalid |
| pmaUser | *6C8DC88838BA26F23FC09ED48861E966C911B4CB |
+-------------+-------------------------------------------+
4 rows in set (0.002 sec)
Now unable to login to phpMyAdmin with username "pmauser" and my root password.

Stopped and restarted mysql.
Ran "mysql_secure_installation" again.
This time changed password as per wiki.
Quote:
Password updated successfully!
Reloading privilege tables..
... Success!
Followed wiki stages to end.

Still refused login with access denied. Tried all lower case username as well.

mysqli_real_connect(): (HY000/1045): Access denied for user 'pmaUser'@'localhost' (using password: YES)

Checked Maria was restarted, still refused login via phpMyAdmin.
Got back into MariaDB from terminal using the new changed password and got this ...
Quote:
MariaDB [(none)]> SELECT User, password FROM mysql.user;
+-------------+-------------------------------------------+
| User | Password |
+-------------+-------------------------------------------+
| mariadb.sys | |
| root | *FD13D9FBB28354DE0F12ABB95F4E1DBC1AD1EDD1 |
| mysql | invalid |
| pmaUser | *6C8DC88838BA26F23FC09ED48861E966C911B4CB
Now stuck !
Have to go to day job now, back this evening.
 
Old 06-01-2021, 08:34 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,553

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Are you able to log in to mariadb in a terminal using root user and root password?
Are you able to log in to mariadb in a terminal using pmaUser and pmaUser password?

If so, you may need to configure phpmyAdmin. Don't use it myself so can't help with that.

Quote:
Now unable to login to phpMyAdmin with username "pmauser" and my root password.
If you are logging in as pmaUser, you need to use the pmaUser password. Not sure if I understood that comment?

Last edited by yancek; 06-01-2021 at 09:10 AM.
 
Old 06-01-2021, 11:28 AM   #6
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks for help.

Thank you again - yancek.

Got confused with pmauser from the wiki and so did not try "root" with phpMyAdmin.
Success with both MariaDb and phpMyAdmin.

Will now move on to actually learning/using it.
Help much appreciated.
Over and out.
Paul
 
  


Reply



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
[SOLVED] How to write the rewrite rule in /etc/apache2/apache2.conf? luofeiyu Linux - Server 1 09-20-2015 08:11 AM
Apache2 Server...File not found /htdocs scottley Debian 11 11-25-2012 08:10 PM
/etc/hosts, /etc/resolve.conf and /etc/host.conf config probs below_average Linux - Networking 1 12-08-2004 10:07 PM
Linux SMB Svr <-> Linux Clnt and roaming profiles Normanu Linux - Networking 1 11-24-2004 10:29 AM
Redhat And Web Svr ramzi Linux - Software 15 09-26-2003 12:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration