Welcome, Guest. Please login or register.
April 17, 2014, 18:33:38 PM
Home Help Search Calendar Login Register
Show unread posts since last visit.
News: Let Pardus-Anka become #1: Pardus-Anka Bug ReportPardus-Anka World Google+ | The Pardus wiki  | Visit Pardus-Anka official website  | Register as forum member?  Email the moderator!

+  Pardus Worldforum
|-+  Assistance
| |-+  Software
| | |-+  LAMP
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] Go Down Print
Author Topic: LAMP  (Read 4070 times)
Mailman
Pardus fellow craft
**
Posts: 61


View Profile
« Reply #15 on: September 18, 2007, 12:47:48 PM »

Yes, I do get the login page at http://localhost/phpmyadmin/ but I've never set a username and/or password.
Where can I create these?
Logged
roverrat
Pardus Master
***
Posts: 236



View Profile
« Reply #16 on: September 18, 2007, 13:54:02 PM »

I'm not sure but I think PhpMyAdmin has a setup script that you can use.
See if it's under  http://localhost/phpmyadmin/scripts/setup.php
Logged
DANHO
Pardus Master
***
Gender: Male
Posts: 187


Pardus SF


View Profile
« Reply #17 on: June 17, 2008, 21:06:53 PM »

Im currently virtual hosting 2 sites with apache on a pardus machine.
.
.
I would like to make one site log-in capable for a few users.
I never get pass creating a password and user.
Any and all help is appreciated.
links/tutorials on same topic also welcome.
.
.
.
stonecuban@pardus ~ $ sudo pisi update-repo
Password:
* Updating repository: pardus-2007.3
pisi-index.xml.bz2.sha1sum     (40.0  B)100%      0.00 B/s [??:??:??] [complete]
pisi-index.xml.bz2             (480.0 KB)100%     86.63 KB/s [00:00:01] [complet
e]
No signature found for http://paketler.pardus.org.tr/pardus-2007.3/pisi-index.xm
l.bz2
Updating package database of pardus-2007.3 (100%) [complete]
* Package database updated.
stonecuban@pardus ~ $ sudo pisi it apache mysql-server mod_php
The following package(s) are already installed and are not going to be installed
 again:
apache mysql-server mod_php
No packages to install.
stonecuban@pardus ~ $ su
Password:
pardus stonecuban # mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h pardus password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

pardus stonecuban # service mysql-server start
Service 'mysql-server' started.
pardus stonecuban # mysqladmin -u root password thesecret
pardus stonecuban #
pardus stonecuban # /usr/bin/mysqladmin -u root -h pardus password thesecret
/usr/bin/mysqladmin: connect to server at 'pardus' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet            ', system error: 111'
pardus stonecuban #   
.
I need help creating password and user.
« Last Edit: June 17, 2008, 22:55:21 PM by DANHO » Logged
DANHO
Pardus Master
***
Gender: Male
Posts: 187


Pardus SF


View Profile
« Reply #18 on: June 18, 2008, 04:17:11 AM »

.
.
.
.
.
Here's a better output.
.
stonecuban@pardus ~ $
stonecuban@pardus ~ $ service apache start
Service 'apache' started.
stonecuban@pardus ~ $
stonecuban@pardus ~ $ sudo pisi update-repo
Password:
* Updating repository: pardus-2007.3
pisi-index.xml.bz2.sha1sum     (40.0  B)100%      0.00 B/s [??:??:??] [complete]
No updates available for repository pardus-2007.3.
stonecuban@pardus ~ $ sudo pisi it apache mysql-server mod_php
The following package(s) are already installed and are not going to be installed again:
apache mysql-server mod_php
No packages to install.
stonecuban@pardus ~ $ su
Password:
pardus stonecuban # mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
pardus stonecuban #
pardus stonecuban # service mysql-server start
Service 'mysql-server' started.
pardus stonecuban #
pardus stonecuban # mysqladmin -u root password (xx)
pardus stonecuban #
pardus stonecuban # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is (xx)
Server version: 5.0.51-log Pardus Linux

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
.
Not bad, just bad to the bone.
Any and all  help/links is appreciated on how to proceed.  (whats next?)                                                       
« Last Edit: June 18, 2008, 05:07:58 AM by DANHO » Logged
roverrat
Pardus Master
***
Posts: 236



View Profile
« Reply #19 on: June 18, 2008, 10:03:57 AM »

If it's just a few users you want to give access to you site using MySQL is overkill. You're probably better off doing this using .htaccess and .htpasswd files. 

Just add these two files to your site. You can create .htaccess (don't forget the dot in the name!) using a text editor. Its contents should be something like this:

Code:
AuthType Basic
AuthUserFile /path/to/the/.htpasswd
AuthName "Password protected site"
require valid-user

Put the file in the directory that you want to protect.

The other one, .htpasswd, contains the passwords for the users that are allowed access to the site.

You can create it with the follwoing command:

Code:
htpasswd -c .htpasswd your-user-name

where your-user-name is the login name of the user you want to give access.  You will have to enter a password for that user. The htpasswd utility creates a file called .htpasswd in your current directory. Just move it to the directory you want to protect (like the .htaccess file).

If you want more info on this just search for .htaccess on google. That should give you plenty of useful links.
Hope this helps,
Alex
Logged
DANHO
Pardus Master
***
Gender: Male
Posts: 187


Pardus SF


View Profile
« Reply #20 on: June 18, 2008, 18:21:58 PM »

Thanks Roverrat, htaccess is another good alternative, but I would like to setup mysql and php so that users can be able to edit and add to the website's webpages.
.
With .htaccess  you can protect files, folders, and webpages in or out the network from being viewed. A log-in prompt will appear asking for user and password info.
.
I accomplished this by creating and placing two text files (.htaccess & .htpasswd) in the folder I want to protect.
.
.htaccess file should look like this;
.AuthName "Login to the Private Area"
AuthType Basic
AuthUserFile /var/www/localhost/the protected file/.htpasswd
Require user stonecuban
.
.
I could'nt create an encrypted .htpasswd file by running these two commands in terminal?
htpasswd -cmb .htpasswd user password
or
htpasswd -c .htpasswd user password
.
So I went to this link
http://users.abac.com/cgi-bin/pass.pl 
and typed in a password and in return it gave an encrypted code of my password which I simply pasted alongside my user name followed by a colon in the .htpasswd file.
.
.htpasswd file should look like this;
.
stonecuban:klgytumkjcvf
.
Restart server or servers.
Visit your new "login required" protected webpage in or out the network.
.
But we're talking Lamp here.
.
I would like to setup mysql and php so that users can be able to edit and add to the website's webpages.
I've gotten as far as my results here.
.
pardus stonecuban # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is (xx)
Server version: 5.0.51-log Pardus Linux

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
« Last Edit: June 19, 2008, 17:56:28 PM by DANHO » Logged
roverrat
Pardus Master
***
Posts: 236



View Profile
« Reply #21 on: June 24, 2008, 17:33:31 PM »

Danho,

sorry, I have been away for a couple of days. So you've got MySQL up and running. That's great :-)

Using MySQL Admin you can creat a user data base like this:

Code:
mysqladmin -h localhost -u root -ppassword create apache_auth
mysql -h localhost -u root -ppassword
mysql> use apache_auth
mysql> create table mysql_auth ( user_name char(30) NOT NULL,user_passwd char(60) NOT NULL,primary key (user_name) );

To actually add a user do something like this:

Code:
mysql> insert into mysql_auth values('Alex','secretpassword');

You will have to tell Apache to use MySQL for authentification. I suggest you use the module mod_auth_mysql for this. After installing it edit your httpd.conf like so:

(Example)

Code:
<Directory /path/to/protected_dir>
     AuthType Basic
     AuthName "Please login to this site"
     AuthMySQLHost localhost
     AuthMySQLUser db_user
     AuthMySQLPassword db_password
     AuthMySQLDB apache_auth
     AuthMysqlUserTable  http_auth
     AuthMySQLEnable on
     require valid-user
     </Directory>

« Last Edit: June 24, 2008, 17:35:04 PM by roverrat » Logged
DANHO
Pardus Master
***
Gender: Male
Posts: 187


Pardus SF


View Profile
« Reply #22 on: June 25, 2008, 02:04:12 AM »

Hey thanks, I think thats what I need.
I'm on it! thanks.
.
.
stonecuban@pardus ~ $ service apache restart
Service 'apache' stopped.
stonecuban@pardus ~ $ service apache restart
Service 'apache' stopped.
Service 'apache' started.
stonecuban@pardus ~ $ sudo pisi it apache mysql-server mod_p
hp
stonecuban@pardus ~ $ Password:
The following package(s) are already installed and are not g
oing to be installed again:
apache mysql-server mod_php
No packages to install.
.
stonecuban@pardus ~ $ mysqladmin -u root password 'password'
stonecuban@pardus ~ $
stonecuban@pardus ~ $ mysqladmin -h localhost -u root -p'password' create apache_auth
stonecuban@pardus ~ $
stonecuban@pardus ~ $ mysql -h localhost -u root -ppassword
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.51-log Pardus Linux

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
mysql>use apache_auth
Database changed
mysql> create table mysql_auth ( user_name char(30) NOT NULL
,user_passwd char(60) NOT NULL,primary key (user_name) );
Query OK, 0 rows affected (0.00 sec)

mysql> insert into mysql_auth values('StoneCuban','mypassword')
;
Query OK, 1 row affected (0.00 sec)
.
"quit, restart mysql, and go back"
.
mysql>
mysql> use apache_auth;
Reading table information for completion of table and column name
s
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT * from mysql_auth;
+------------+-------------+
| user_name  | user_passwd |
+------------+-------------+
| StoneCuban | mypassword     |
+------------+-------------+
1 row in set (0.00 sec)

mysql> \q;
Bye
.
stonecuban@pardus ~ $ service mysql-server restart
Service 'mysql-server' stopped.
Service 'mysql-server' started.
stonecuban@pardus ~ $ service apache restart
apache error: Unable to stop: Syntax error on line 916 of /etc/apache2/httpd.conf:
LoadModule takes two arguments, a module name and the name of a shared object file to load it from

.
.
.
httpdconf;
#
LoadModule mod_auth_mysql        (?something missing here?)
#
<Directory /var/www/localhost/stonecuban/testar>
     AuthType Basic
     AuthName "Please login to this site"
     AuthMySQLHost localhost
     AuthMySQLUser db_user
     AuthMySQLPassword db_password
     AuthMySQLDB apache_auth
     AuthMysqlUserTable  http_auth
     AuthMySQLEnable on
     require valid-user
     </Directory>
#
How do I include "mod_auth_mysql" in the server configturation?




« Last Edit: June 25, 2008, 20:55:59 PM by DANHO » Logged
Pages: 1 [2] Go Up Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!