In this step-by-step-tutorial, learn how to set up a personal web server with a Raspberry Pi 3. Owning a little cloud has a lot of benefits and can save you over $100 per month. In this step-by-step-tutorial, learn how to set up a personal web server with a Raspberry Pi 3. The Raspberry Pi 3 is a very capable, low power consuming little piece of kit. Combine that with the awesome power and speed of PHP 7.0 and you have a low energy web server that’s lightning quick and ideal for blogging from.
A printer isn't the most convenient of peripherals. You can also browse through its extensive documentation from the CUPS browser-based control panelUnless you have created a custom user, the default user on Raspbian is called pi. Use the following command to allow it to interact with the printer: $ sudo usermod -a -G lpadmin piHere we use the usermod tool to add ( -a ) the pi user to the lpadmin group ( -G ). By default, CUPS can only be configured from the local computer that it's installed on.Because that doesn't work in our case, we need to edit its configuration file to allow us to make changes to the server from a remote computer.
First of all, you need to create a backup of the original configuration file with:$ sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.origThen open the file with the nano text editor: $ sudo nano /etc/cups/cupsd.conf. Inside the file, scroll down to the following section:# Only listen for connections from the local machineListen localhost:631Comment out that line (by adding the # to the beginning of the line) and add another to ask CUPS to accept connects from any computer on the network. Make sure the section looks like this:# Only listen for connections from the local machine# Listen localhost:631Port 631Then scroll further down in the configuration file until you reach the sections, and add a new line that reads Allow @local just before the close of the section. The section with the appended line should now read like this:# Restrict access to the serverOrder allow,denyAllow @localNow add the Allow @local line to the other two Location sections – andSave the file and restart the CUPS server with: $ sudo /etc/init.d/cups restartYou should now be able to access the CUPS administration panel via any computer on your local network by pointing the web browser to your Pi. Then follow the walkthrough over the page to add your printer to CUPS.Some Linux distros ship with a restrictive iptables firewall policy that doesn't allow connections via the CUPS ports.Even if Raspbian doesn't, make sure it doesn't throw up any unexpected errors by punching holes in the firewall with:$ sudo iptables -A INPUT -i wlan0 -p tcp -m tcp -dport 631 -jACCEPT$ sudo iptables -A INPUT -i wlan0 -p udp -m udp -dport 631-j ACCEPTIf you connect to the Raspberry Pi via Ethernet instead of a wireless adaptor, modify the command and replace wlan0 with eth0.
When you are through setting up your printer using the CUPS administration panel, it's time to make it accessible to other machines on your network.While Linux distros will have no trouble detecting your new network printer, making them visible to Windows and Apple devices requires a couple of extra steps. From the Printers tab, you can track the status of every job on every printer Network-wide accessFor Windows, install the Samba server on the Raspberry Pi with $ sudo apt-get install samba. Then open its configuration file (/etc/samba/smb.conf) in the nano text editor and hunt for the section labelled printers and make sure it contains the line:guest ok = yesThen scroll down to the print$ section and change its path to the following:path = /usr/share/cups/driversThen scroll up to the Global Settings section at the top of the configuration file.
Modify the workgroup parameter within to point to the name of your workgroup, which by default is named WORKGROUP.Also enable the wins support by adding the line wins support = yesNow save the file and restart Samba with $ sudo /etc/init.d/samba restart.Then head over to the Windows machine and launch the Add New Printer wizard and click on the option to install a network printer. Thanks to the modified Samba configuration, the wizard will detect and list any printers hooked up to the Raspberry Pi.If you have Apple devices, you can enable support for Apple's AirPrint system, which allows you to print from the iPad and iPhone.
For this, just install the Avahi daemon with sudo apt-get install avahi-daemon on the Raspberry Pi, which will then make the connected printer visible to AirPrint-compatible devices.In addition to the ability to use our network printer from within graphical applications across all platforms, we can also use it to print from the command line interface. Furthermore, we can also interact with the printer using the Python programming language.
Once raspbain is burnt to microSD card. Copy raspbian root directory address, open terminal on home machine, change directory to copied root directory address. Modify file named interfaces in etc/network directory to look like one shown in attached image. Once done, create an empty file named 'ssh' in raspbian boot directory. Finally takeout microSD card from card reader and insert it in raspberry pi.
Following that turn on your raspberry pi.Once Raspberry pi boots up find IP address of raspberry pi using network scanning application like. Using obtained IP address you can remote login to raspberry pi with ssh from terminal in linux and software like putty in windows. Once SAMBA is installed we need to edit configuration file so it knows where to look for our 'Testfolder'. Open configuration file with sudo nano /etc/samba/smb.confand to the bottom of this file add following settings.Pi share comment = Pi shared folderpath = /home/pi/Sharebrowseable = yeswriteable = Yesonly guest = nocreate mask = 0777directory mask = 0777public = yesguest ok = yesOnce done, save and exit.Following this we need to reset SAMBA password using sudo smbpasswd -a Finally restart SAMBA with sudo /etc/init.d/samba restartand we are done.