Installing Drupal on NethServer

NethServer Version: 7 rc2

Hi everyone,

I konw this is one stupid question… but after a few hours of searching i decided to ask you. How can i create databases (mysql…mariadb)? Because i browsed all modules… i found maria db installed but i don’t find any link to a page, or a module where i can create my site database. I tried cu acces phpmyadmin but i got a permision denied. So is there a easy way to create a mysql database?

Hi @liviu. There’s a phpmyadmin module for NethServer in an external package repository. To install it you can follow the instructions for NS7:

http://wiki.nethserver.org/doku.php?id=phpmyadmin

Or you could get your hands dirty and dive into the commandline. There are loads of websites explaining how to create a database and a user in MySQL/MariaDB (they have the same syntax)
(don’t forget that every mysql/mariadb command ends with a ; (semicolon))

May I ask what you need to create a database for?

Sure… i want to use drupal for my web site…

So… there is no easy way of creating a database and a user for that database. I was hoping there would be a category in nethserver panel which would allow me to create a database a an user for that database.

And one more question… Although i created a virtual host with ftp acces i can’t upload anything to my site (ftp server is running and ftp acces for thar virtual host user is allowed for any networks) with filezilla. If i use winscp i can acces var/www/html but with the user root and i belive that shouldn’t be the way.

Hi Liviu,

You can try one of these (there are a lot of examples on internet):

http://orangeweb.com.au/installing-drupal-8-centos-7
https://www.atlantic.net/community/howto/install-drupal-centos-7-apache/
https://www.howtoforge.com/centos-7-drupal-installation

In all these examples you will find how to create db.

1 Like

Thank you!! I’ll give a try!!

1 Like

Remember that anything you want to install on NS and is not in Software center or in NS NetForge, it’s like you want to install on CentOS.
Usually should work without any issues for NS.
So, you can search the Internet to find “How To install something on CentOS 7”.

PS:
This is the short story! :wink:

To be honest, I was afraid to install anything outside software center. For me it was like… out of the question… I was afraid… and still I am. But I guess I have to risk!

1 Like

You must be careful to anything which can be in conflict with what NS has already installed as a part of NS (Apache, MariaDB, …). This is also the “short story” but you can try.
The best way is to try first on VM. But even here, there are some issues that could appear, usually not from NS but how the VM is connected to outside.

PS:

The most important thing: do not test anything on a production server!

Drupal will not end up as something that you can manage through the NethServer interface. But installing Drupal is easy enough to do it over the commandline.
Creating a database for Drupal on NethServer is the same as on any other distribution. You can have a look at my Moodle installation howto in this forum: the part of creating a database and database user is the same: (change moodle for drupal)
Prerequisites are that you have the database module and the webserver module installed.

quote:

Create a mysql database and user for MoodleDrupal

The password for mariadb root account is stored in /var/lib/nethserver/secrets/mysql.

cat /var/lib/nethserver/secrets/mysql

Copy the password.
Now open a mysql prompt:
mysql -u root -p
Fill in the copied password and you will be in the Mariadb prompt:
MariaDB [(none)]>
Remember, every command you give in the Mariadb prompt must end with a ;

MariaDB [(none)]> create database moodledrupal;
MariaDB [(none)]> create user ‘moodledrupal’@‘localhost’ identified by ‘chooseyourdrupalpassword’;
MariaDB [(none)]> grant all privileges on moodledrupal.* to ‘moodledrupal’@‘localhost’;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
Bye

3 Likes

Hi,

have checked out the command “mysql” of a ssh-console? It is usually installed with every MySQL server.

regards mario

Guys,

You are a great community… i think the best i have ever seen…
On the other hand… i will give developers some suggestions that they could consider for future versions of nethserver (i hope this won’t sound bad because this is not my intention)…
It would be great if you could make a menu with databases and users for those databases (that would make nethserver more user friendly and would reduce the risk of doing something wrong).
It would be great to create a menu for different php versions (so you can choose any php version for every site you host on your server).

Thank you all for your suggestions and for your time you lost with me!!

done by nethserver-phpscl, yet only for ns6

I would in the future base all my work on php-fpm and get rid of php-mod

it exists also for ns6 and ns7, install nethserver-phpmyadmin, it is the purpose of this software.

all relative documentation to install external modules are there modules [NethServer Wiki]

May I suggest that you install first nethserver-shellinabox, you will have a terminal in your web browser where you can copy and paste command like in your terminal.

Welcome on board @liviu

2 Likes

Hi @liviu,
Thanks for your suggestions. It is great to hear what people drive and what they seek in a (Neth)Server distribution. Making it the sysadmin’s life easier is always a trade-off between flexibility and ease-of-use.
Although I do appreciate the suggestions you posted, I also want to point to the need of knowing what you are doing. A point and click system most of the time doesn’t help with that deeper knowledge. Diving into the commandline does, although it also is a steep learning curve. But remember, for each part you want to accomplish, you can find a how-to. Like in the create database and user in MySQL/MariaDB example.
I wrote the how-to install Moodle on NethServer. Even though I can find my way now on the commandline, I come from a Microsoft environment, so commandline was completely new to me a few years ago.
I can only say: you will learn the fastest by doing.
So my suggestion would be: dive into the commandline and when you can find your way, feel free to use the handy point and click tools that come with NethServer.
You might want to create a howto install Drupal on NethServer. If you want to document your Drupal install, please do so. And if you run into anything, just yell. I have installed Drupal several times on Ubuntu, and know that installing Drupal is very similar to installing Moodle. Feel free to use the Moodle install howto as an example.

1 Like

I’m back again with questions…

First of all… thank you for the support.
So I installed phpmyadmin… but i have another problem logging to mysql… phpmyadmin returns “Cannot log in to the MySQL server” and i’m getting the same problem in terminal “acces denied for user root@localhost”… i think mysql doesn’t recognise root as user… is there something i missed somewhere?

Stephane, i followed your tutorial on installing phpmyadmin for nethserver 7. Everything went almost fine. And i say almost because there is no /etc/my.pwd but i think it is /etc/my.cnf which doesn’t have in it any admin password.

sorry I will modify the documentation, the path is /root/.my.cnf

cat /root/.my.cnf

Great. It’s working now! Thank you!!!

after you can change IN phpMyAdmin the password of the user admin by something more easy…of course 123456 is not advised

First thing i did was change the password… And i used a bit more complex password than 123456 :smile: I can only hope to remember the new password :smile:

But still i was wondering why i couldn’t log in with root and the same password i use for my server. I saw that root is listed as user so it should work, i think.