Blank page on installing Grav - grav

I have download grav zip file and extract it to my web server or local host.iam using fedora OS with PHP version 5.6.23.on navigating localhost/grav in browser,it shows a blank page.can anyone help me to solve this?

Check /var/log/httpd/error_log, if you see errors about file permission, maybe SELinux prevented web server from writing configuration files. This often happens to a fresh installation of Fedora/apache.
You can try this:
From terminal, run su -c "dnf install policycoreutils-python-utils" to install policycoreutils-python-utils package which provides semanage
Run su -c "semanage permissive -a httpd_t" to ask SELinux to monitor apache in permissive mode and allow apache to write to its public folder.
Now refresh the page to see if Grav is now running.
If this doesn't work and you want to reserve the command semanage permissive -a httpd_t, you run semanage permissive -d httpd_t (more details)

Related

How to give my RStudio server "sudo" access?

I tried to dir.create on a path that I need sudo access to create directories. But I can't seem to do it from Rstudio server instance of Rstudio that I access from the browser, even though I started the Rstudio server using sudo rstudio-server start.
Is there a way to give my Rstudio instance sudo powers?
When you use the RStudio Server web client, it executes local scripts as the "rstudio-server" user on your Linux machine (run cut -d: -f1 /etc/passwd to list local users and it will appear there). You need to ensure that the rstudio-server user and the user you log onto the client with has rwx permissions across the directories you want to make changes in from RStudio.
sudo setfacl -m u:rstudio-server:rwx /path/
sudo setfacl -m u:localuser:rwx /path/

Multi user signin on JupyterHub

I'm trying to setup JupyterHub on an Amazon EC2 instance using these instructions.
In the step titled Run the Hub Server I'm running the server using sudo jupyterhub. But I'm not able to login using the credentials of other Linux users (those apart from the one used to run the server).
It says No such file or directory: 'jupyterhub-singleuser' in the logs and I get a 500 internal server error in the browser. Please help!
Here's how to set up jupyterhub for use with multi-users:
My github here will help you.
Github/Jupyter
Create a group:
$ sudo groupadd <groupname>
Add a user to a group:
$ sudo adduser <username> <groupname>
Using:
c.LocalAuthenticator.group_whitelist = ['<groupname>']
It's been a long time since you asked this, but I think a I can help other users that have similar problems.
I think the problem is that jupyterhub-singleuser is not in PATH for all users. The solution I used was to make symbolic links for the binaries jupyterhub requires.
sudo ln -s /your/jupyterhub/install/location/jupyterhub /usr/bin/jupyterhub
sudo ln -s /your/jupyterhub/install/location/configurable-http-proxy /usr/bin/configurable-http-proxy
sudo ln -s /your/jupyterhub/install/path/node /usr/bin/node
sudo ln -s /your/jupyterhub/install/path/jupyterhub-singleuser /usr/bin/jupyterhub-singleuser
I think it will work

Enable nginx module on Laravel Homestead?

How can I install and enable the file upload and upload progress module on nginx with the Laravel Homestead box on Vagrant?
I believe all you need to do, like it was mentioned above, is log in with ssh to your box and install the nginx-extras package. So:
Got to your Homestead directory.
Do 'vagrant ssh'
Once in do 'sudo apt-get install nginx-extras'
Restart nginx with 'sudo service nginx restart'
Check for the module in the output of 'sudo nginx -V'. Messy but you should see 'nginx-upload-progress' somewhere near the end of the output.
You can do everything via ssh. Read more detail about using ssh in Homestead at here.

How to install R on Solaris on a VirtualBox virtual machine?

This Q&A is a response to this comment. The answer to the question in the comment is not trivial, is too big for a comment, and not suitable as an answer to the question in that thread (answering my own question is officially encouraged). If you have a better answer please post it!
The question is: How to install R on Solaris on a VirtualBox virtual machine?
A more up-to-date version is available from csw: r_base. To install, see the example in Getting started where you replace vim with r_base:
pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -a r_base
/opt/csw/bin/pkgutil -y -i r_base
To install a development environment, you might also want:
/opt/csw/bin/pkgutil -y -i gcc4g++
/opt/csw/bin/pkgutil -y -i texlive
Start by downloading and installing Oracle VM VirtualBox.
Then download and unzip the Oracle Solaris 11.1 VirtualBox Template. After you unzip the Oracle template you should see a file called OracleSolaris11_1.ova, that's what you'll open in VirtualBox.
Start VirtualBox, click on File, then Import Appliance, then navigate to chose the ova file you just extracted. It will take some time to import.
Start the Solaris virtual machine by clicking on the start button on VirtualBox. It will take some time to start up and you'll be prompted to add a root password, user name and user password. You'll then use those details to log in, wait for the system to load, choose gnome to ensure you get a desktop environment, and choose your time zone, keyboard layout and language (mine seems to highlight Chinese as the default choice, so be careful not to click through that one too quickly).
Eventually you'll get a desktop, right-click on the desktop and click open terminal, then in the terminal type (or paste):
sudo wget https://oss.oracle.com/ORD/ord-3.0.1-sol10-x86-64-sunstudio12u3.tar.gz && sudo wget https://oss.oracle.com/ORD/ord-3.0.1-supporting-sol10-x86-64-sunstudio12u3.tar.gz
That will connect to the internet and download two files you need. The next line will unpack those two archives:
sudo tar -xzvf ord-3.0.1-sol10-x86-64-sunstudio12u3.tar.gz && sudo tar -xzvf ord-3.0.1-supporting-sol10-x86-64-sunstudio12u3.tar.gz
And then this next line installs R, watch for the prompts after you run the line:
sudo bash install.sh
A lot will flash by in the terminal, concluding with Installation of <ORD> was successful
Now the next bit is where I deviate from the instructions here because I didn't understand them. You'll move all files beginning with lib from the archives that you unpacked into another directory where they are needed by R:
sudo mv lib* /usr/lib/64/R/lib/
That will return nothing in the terminal. Then we can run R simply by typing in the terminal like so
R
And now you should have a regular R session running in the terminal.

How do I set up phpMyAdmin on a Laravel Homestead box?

I installed it by running sudo apt-get install phpymyadmin and then running
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html and sudo service nginx restart
but it's not working.
Note: I didn't select any of the apache2 or lighttpd options when installing.
Option 1:
This will install the latest version of PhpMyAdmin from a shell script I've written. You are welcome to check it out on Github.
Run the following command from your code/projects directory:
curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | bash
Option 2:
This will install PhpMyAdmin (not the latest version) from Ubuntu's repositories. Assuming that your projects live in /home/vagrant/Code :
sudo apt-get install phpmyadmin Do not select apache2 nor lighttpd when prompted. Just hit tab and enter.
sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/code/phpmyadmin
cd ~/Code && serve phpmyadmin.test /home/vagrant/code/phpmyadmin
Note: If you encounter issues creating the symbolic link on step 2, try the first option or see Lyndon Watkins' answer below.
Final steps:
Open the /etc/hosts file on your main machine and add:
127.0.0.1 phpmyadmin.test
Go to http://phpmyadmin.test:8000
Step 1:
Go to the phpMyAdmin website, download the latest version and unzip it into your code directory
Step 2:
Open up homestead.yaml file and add these lines
folders:
- map: /Users/{yourName}/Code/phpMyAdmin
to: /home/vagrant/Code/phpMyAdmin
sites:
- map: phpmyadmin.test
to: /home/vagrant/Code/phpMyAdmin
Step 3:
Open your hosts file and add this line:
127.0.0.1 phpmyadmin.test
Step 4:
You may need to run vagrant provision to load the new configuration if vagrant is already running.
Thats it
Go to http://phpmyadmin.test:8000. It should work from there. Great thing about this method is that if you ever need to destroy your box, you won't ever have to set up phpMyAdmin again so long as you keep your homestead.yaml file and phpMyAdmin in your code directory.
===========
Important update from DaneSoul:
I tried this instruction on Homestead 5.3 and have met a problem "No input file specified" when trying open http://phpmyadmin.test.
And finnaly I found solution:
You need unpack phpmyadmin to
/home/vagrant/Code/phpMyAdmin/public
And write in homestead.yaml
- map: phpmyadmin.test
to: /home/vagrant/Code/phpMyAdmin/public
So almost all the same, but this /public directory in paths makes it working!
Also, in my configuration I use http://phpmyadmin.test, not http://phpmyadmin.test:8000.
Update Note: Follow this article to change your domain extension.
The answer from Nikos Gr worked for me; however I needed to amend steps 2 and 3 as my host system has issues creating the symlink.
I changed:
sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/Code/phpmyadmin
cd ~/Code && serve phpmyadmin.app /home/vagrant/Code/phpmyadmin
To:
cd ~/Code && serve phpmyadmin.app /usr/share/phpmyadmin/
(Couldn't comment on the original solution as my rep isn't high enough!)
A simplified version of Jyeon's Answer. You don't need to share the ~/Code folder in the Homestead.yaml file:
folders:
- map: /Users/{yourName}/Code/phpMyAdmin
to: /home/vagrant/Code/phpMyAdmin
Just download the latest version of PhpMyAdmin from PhpMyAdmin and put the unzipped file in the ~/Code/phpMyAdmin folder and just follow the 2 step here:
Step 1:
Open up homestead.yaml file and add these lines
sites:
- map: phpmyadmin.app
to: /home/vagrant/Code/phpMyAdmin
Step 3:
Open up your hosts file and add this line:
192.168.10.10 phpmyadmin.app
Now run the vagrant reload --provision command and you're good to go.
Open up the phpmyadmin.app address in your browser and you'll see the phpmyadmin interface.
Install phpMyAdmin
SSH into Homestead vagrant box with vagrant ssh and type the following command:
sudo apt-get install phpmyadmin
When prompted to select the Web server, select apache2 and press Enter, just to get pass it.
When prompted to config database for phpmyadmin with dbconfig-common, select Yes and press Enter.
When prompted for Password of the database's administrative user, enter secret and press Enter.
When prompted for MySQL application password for phpmyadmin, enter secret and press Enter.
When prompted for Password confirmation, enter secret again and press Enter.
Then Create and config site for Nginx
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html/phpmyadmin
cd /etc/nginx/sites-available
sudo cp homestead.app phpmyadmin.app
sudo sed -i 's/homestead.app/phpmyadmin.app/g' /etc/nginx/sites-available/phpmyadmin.app
sudo sed -i 's/home\/vagrant\/Code\/Laravel\/public/usr\/share\/nginx\/html\/phpmyadmin/g' /etc/nginx/sites-available/phpmyadmin.app
sudo ln -s /etc/nginx/sites-available/phpmyadmin.app /etc/nginx/sites-enabled/phpmyadmin.app
sudo service nginx restart
sudo service php5-fpm retart
Adding phpMyAdmin.app to your hosts file
127.0.0.1 phpmyadmin.app
Navigate to http://phpmyadmin.app:8000 and you should now see phpMyAdmin login page.
More info available here if you need it
A variation on Nikos Gr's answer that seemed a bit simpler (in that it doesn't require a new symbolic link for each project on your Homestead box) and worked for me.
Inside the Homestead box, run sudo apt-get install phpmyadmin. Don't select any of the options during install.
On your host machine, add the following lines to your Homestead.yaml file:
- map: phpmyadmin.dev
to: /usr/share/phpmyadmin
On your host machine, add the following line to your hosts file:
192.168.10.10 phpmyadmin.dev
...and Homestead's phpMyAdmin will be available at phpmyadmin.dev
You can install phpmyadmin automatically when you vagrant up or provision your homestead by adding the following snippet to your Homestead\scripts\homestead.rb file after # Update Composer On Every Provision
# Install phpMyAdmin on every provision
config.vm.provision "shell" do |s|
s.inline = "curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | sh"
end
Your hoomestead.rb file should now look somehow like this
class Homestead
def Homestead.configure(config, settings)
# Configure The Box
config.vm.box = "laravel/homestead"
config.vm.hostname = "homestead"
# Configure A Private Network IP
config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"
some other entries are truncated to keep this short
# Update Composer On Every Provision
config.vm.provision "shell" do |s|
s.inline = "/usr/local/bin/composer self-update"
end
# Install phpMyAdmin on every provision
config.vm.provision "shell" do |s|
s.inline = "curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | sh"
end
# Configure Blackfire.io
if settings.has_key?("blackfire")
config.vm.provision "shell" do |s|
s.path = "./scripts/blackfire.sh"
s.args = [settings["blackfire"][0]["id"], settings["blackfire"][0]["token"]]
end
end
end
end
Save file and run vagrant destroy then vagrant up or just vagrant reload
NB: This uses Nikos Gr script located here https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh
Finally it worked for me, few things I had to fix:
Homestead.yaml file:
- map: phpmyadmin.test
to: /home/vagrant/code/phpmyadmin/
I had to delete /public from the end. I installed phpmyadmin (after vagrant ssh command from Homestead directory) into the 'code' folder where the other projects are. When 'code' is with lowercase, it has to be everywhere so (or other way around): folder name, yaml file or even after installation performing these commands:
sudo ln -s /usr/share/phpmyadmin/ /home/vagrant/code/phpmyadmin
cd ~/code && serve phpmyadmin.test /home/vagrant/code/phpmyadmin
This is the most simple solution. No mapping and all needed.
Download latest phpmyadmin version from here https://www.phpmyadmin.net/downloads
Make a folder named phpmyadmin inside your main root/public folder and unzip phpmyadmin here.
Run yourwebsite.com/phpmyadmin
I am writing here the way I followed to make my local vagrant environment work-friendly.
Step 1 - Start the vagrant and login
vagrant up
vagrant ssh
Step 2 - Go to your correct directory. (Depends on your file tree)
cd <VagrantDirectory>
Step 3 - Install phpmyadmin.
curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | bash
Step 4 - Configure the Homestead.yaml
map: phpmyadmin.test
to: /home/vagrant/<VagrantDirectory>/phpmyadmin
Step 5 - Reload the vagrant.
vagrant reload
Step 6 - Configure phpmyadmin
Go to your phpmyadmin directory. Copy config.sample.inc.php to config.inc.php
cp config.sample.inc.php config.inc.php
Step 7 - Edit config.inc.php with your text editor and place your new configuration there.
//Comment out the old configuration that was already here.
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost'; // Also works with the IP address.
$cfg['Servers'][$i]['user'] = 'homestead'; // Username of MySQL, Default is homestead.
$cfg['Servers'][$i]['password'] = 'secret'; // Password. Default password is secret
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['CheckConfigurationPermissions'] = false; // Since you are on local, Leave this false.
Step 8 - Now browse your fresh PHPMyAdmin on your favorite browser.
http://phpmyadmin.test
For another alternative that I found super simple and that worked right out of the box I set up a new Nginx site from inside the Homestead box using the serve.sh script:
serve adminer.app /home/vagrant/Code/adminer/
And then in there I dropped the one page successor to phpmyadmin, Adminer. I also renamed it to "index.php" to make it just work. Then after adding the adminer.app entry to my hosts file I was good to go.
Had not used a web based MySQL interface in years since I just didn't like maintaining phpMyAdmin but this one is sweet. One file (plus an optional CSS file if you want a nicer theme) and that is all. Easy to maintain and update.
As I couldn't comment on the Jyeon solution as my rep isn't high enough, I contribute with this answer; worked for me in Linux (openSUSE Leap) with Vagrant 1.8.1 and laravel/homestead (virtualbox, 0.4.0):
Step 1:
Go to phpMyAdmin website, download the latest version and unzip it into your project directory.
Step 2:
Add to your Homestead.yaml file the following lines:
folders:
- map: ~/Code/phpMyAdmin
to: /home/vagrant/Code/phpMyAdmin
Sites:
- map: phpmyadmin.app
to: /home/vagrant/Code/phpMyAdmin
Step 3:
Add to your hosts file the following line:
192.168.10.10 phpmyadmin.app
Step 4:
After start your vagrant environment and connects to machine via SSH, set your virtual host to work with phpMyAdmin with the command serve:
cd ~/Code
serve phpmyadmin.app /home/vagrant/Code/phpMyAdmin/
Thats it!
Go to http://phpmyadmin.app it should work, and you can login with your user and password homestead default. The great thing about this method is that you can set up your phpmyadmin so long as you keep it in your Homestead.yaml file and phpMyAdmin in your Code directory.
In my case accepted solution works ok except:
$ cd ~/Code && serve phpmyadmin.app /home/vagrant/Code/phpmyadmin
dos2unix: converting file /vagrant/scripts/serve.sh to Unix format ...
* Restarting nginx nginx [fail]
php5-fpm stop/waiting
php5-fpm start/running, process 4112
For an unknown reason serve command files creating configuration file as seen in:
$ sudo tail -f /var/log/nginx/error.log
2015/03/18 11:54:16 [emerg] 3671#0: invalid number of arguments in "listen" directive in /etc/nginx/sites-enabled/phpmyadmin.app:2
Edit config:
$ editor /etc/nginx/sites-enabled/phpmyadmin.app
and add 80 to Listen directive at line 2. Apply changes with:
$ sudo service nginx reload
adminer index file is located in adminer/adminer so try :
serve adminer.app /home/vagrant/Code/adminer/adminer
I installed phpMyAdmin from here
then put these settings in config.inc.php:
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '33060';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
and opened via Apache (I had a xampp). In my case i placed phpMyAdmin in D:\xampp\htdocs\pma which allowed me to open at localhost/pma url.
Everything worked!

Resources