How To Develop Websites On Linux

  • 15 minute read
  • Coding, Linux
  • Share on Twitter, LinkedIn

In this article we will look at the tools that can help those who want to develop websites on a Linux platform, from powerful text editors to desktop and system features. How do you edit files remotely without FTP plugins? What are package managers and why are they great? What web browsers can you test your applications in?

I wish I could cover a lot more topics: command line usage, Vim basics, detailed Nautilus features, Nautilus scripts, line tools command command, basic server configuration and many others. But if I covered all the topics that pop up from time to time on the Internet, this article would become a little book. This is not an article on “How to do X or Y on Linux” or “How to use [insert application name here]”. And we can’t cover more comprehensive IDEs like Eclipse and NetBeans, each of which require separate articles.

Be sure to check out our previous articles:

  • Introduction to commands Linux
  • Simple workflow from development to deployment
  • Linux VI Editor/Terminal Cheat Sheet

Probably You already have an idea of ​​how to find and install applications for your favorite distributions. However, we’ll point you to the right place anyway to download, for example, scripts and plugins.

So, let’s get started!

1. Our tools

Below, for your quick reference, is a list of tools that we will mention or explain in this article.

Text editors:

  • Gedit
  • Geany

Browsers:

  • Opera
  • Mozilla Firefox
  • Epiphany (with the WebKit engine)
  • Chromium (for some other WebKit examples)

General and command line tools:

  • FUSE
  • SSHFS
  • Vim
  • Parcellite

2. Gedit

Gedit is the default and simplest text editor for the GNOME environment. The default installation already comes with some nice features, although not all of them are enabled by default. It is bundled with some plugins; however, you can add many more plugins to make it a nice simple IDE. If you go to Edit > Preferences > Plugins, you’ll see which plugins are installed by default. There, you can configure and activate them. On the same screen, you can configure other elements of the text editor, such as indentation, line numbering, and current line highlighting.

Gedit Preferences

Your default installation probably won’t have many plugins. default ins other than those. Check if your distribution has a package to automatically install a set of plugins. The package would be called gedit-plugins. I recommend installing it because it adds at least five useful plugins: support completion, color picker (very useful with your CSS), session saver, smart spaces, and terminal. These are all the plugins installed with the package:

  • Support End
  • Charm Map Selection
  • Code Comment
  • Color Picker
  • Join and Split Lines
  • Session Saver
  • Smart Spaces
  • Show Tab Bar
  • Terminal

See the plugins section for a fuller overview of plugins.

Let’s look at the most useful of these basic plugins for developers and see how we can configure them, if necessary.

Snippets

Snippets insert frequently used snippets of text quickly. To configure it, check it in the plugin tab and press “Configure Plugin”. You can edit existing snippets, add new ones, import and export snippets, and create global snippets. It is also possible to add tab triggers, shortcuts and drop targets. To activate a snippet, you must edit a file with a corresponding snippet (for example, if it’s a Python snippet, you must edit a Python file). If it’s a plain white text file, just change its syntax in View > Highlight Mode. Many good snippets are on the Internet; some I use are Django and RoR snippets.

Snippets

External Tools

External tools execute external commands and shell scripts. As with snippets, you can configure the ones that ship with the plugin or create your own. For more complex tasks, you will need some knowledge of shell-scripting and how to use some of the shell tools. We won’t go into how to master Gedit and its awesome plugins (we recommend reading the Gedit manuals for that), but we will give you links to some scripts you can play with.

Modelines

Yes If you use Vim or Emacs in your daily work, you may know what modelines are. If you want to import them into other text editors, modelines allows you to do exactly that.

For those unfamiliar with them, modelines are “definitions” of tab, spacing, end of line, tab level, etc.

The base and plugin packages from gedit are the ones I use most often. Some other features can be added only through third-party plugins, which you can find all over the Web; GNOME Live’s Gedit section is a good start. Take a look at AutoComplete, Better Python Console (the Python console included with Gedit is only useful for developing gedit plugins), ClassBrowserPlugin, and Autosave edit sessions.

See Also:  Hover-1 Horizon Troubleshooting

Finally, you can customize the Gedit skin with color themes. Gedit includes a few, but you can find many more.

Gedit Themed

Further reading

  • Modelines: Modelines page on the GNOME Library website. </li
  • Gedit Plugins Gedit Plugin Repository on GNOME Live
  • External Tools Plugin External Tools Plugins page on Live GNOME.
  • Text-mate as Gedit in a few stepsA guide with resources to make Gedit more like Text-mate.
  • Using Gedit with Django: A guide to using Gedit for Django programming
  • Django Snippets: Snippets for Django .
  • RoR Development with Gedit A guide to using Gedit for Ruby On Rails programming.
  • RoR Snippets Ruby On Rails Snippets. There are also more snippets here.
  • RHTML Integration: A guide to integrating RHTML into Gedit.

3. Geany

Unlike Gedit, Geany is more of a general purpose “minimalist” IDE than a text editor. It already comes with features such as an integrated terminal, a compiler tab, a messages tab, and a note-taking (Scribble) tab. It also has a side panel list of file symbols (ie classes and methods in Java files, sections and subsections in LaTeX files) and documents that can be expanded to include a tab with file browsing. In addition, Geany comes with a simple completion tool, a color picker, a finder, a simple project builder, and tools for some languages. Its search tool is capable of searching the entire session or just the current file, with or without regular expressions, and a “Find in Files” option if the browser’s file plugin is enabled.

<img src= "https://archive.smashing.media/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/6d65991c-ecb3-4f9b-a8ef-a5badda06231/004.jpg" alt="Geany's main screen" /

However, one of Geany’s best features is its compile and run buttons. Depending on the file you are editing, Geany tries to find the corresponding compiler/interpreter. So if you’re editing a Java file, you can compile it with javac and run it right after the build is done. At the same time, you can compile a LaTeX file and preview it in a really simple DVI viewer without having to change any configuration parameters. For interpreted languages, you don’t even have to run the compiler: just hit “Run”. Of course, if your executable has a different name (say, ruby1.8 instead of ruby), it will fail and report that it couldn’t find ruby. But you just need to set that up to get things working beautifully again.

Geany Compiler output

Another interesting aspect of Geany is its built-in tag information. You can create *.tags files for a language or framework that Geany does not support by default, as well as add support for autocompletion and call hints. See the Geany documentation for more details

Finally, you can extend Geany with plugins (look for the plugin manager in the Tools menu) and themes. Or just set everything how you want: go to “Preferences” and adjust things to your liking, from the browser to your shortcuts.

Further reading

  • Geany Snippets A collection of snippets for use with Geany.
  • SVN/Git integration: how to use Geany with SVN or Git version control systems.
  • Geany Extras Extras to extend Geany .

4. What about remote file editing?

Nowadays, things are quite easy and there is almost no need to install plugins to access FTP and SSH accounts or to edit files, because most of the modern distributions come with FUSE. . And if you have GVFS installed, GNOME integrates it so you can use it in Nautilus.

“But what is it?” you may be asking. In short, it allows you to mount a virtual file system on your system and work there as you would on regular directories.

Just click on a file and start editing it. When you’re done, just save and you’re all set. A big advantage of this method over the FTP plugin method is that it makes things available to more than one application.

FUSE in action

Note: Since my server only has SFTP access, I’m not sure how stable this is with plain FTP, but it works perfectly with SFTP. However , when I need to edit a remote file, I prefer to connect via SSH using a terminal and use Vim to edit the file, just because the method reminds me that I’m not working locally and need to be careful.

Readings Additional Information

  • Mounting the FUSE Filesystem A quick guide to mounting a FUSE system and adding it to fstab.
  • Creating Filesystems with Ruby and FUSE Using FUSE with Ruby

5 FTP and SSH File Explorer, Natively

In newer versions of Nautilus, the GNOME file explorer has native access to network protocols such as WebDAV, FTP, SSH, and Windows shares.You can add other protocols, such as SVN, or extend it through your plugins and scripts.(Lamen tably, I can’t deal with this topic here, I’ll just point you to a website for extensions and scripts.)

You can browse different se rvers at the same time in different windows, which can be very useful for transfer files from one server to another.

Nautilus SSH

Of course, you don’t need to get stuck in the graphical part of Linux. You can use the command line to perform most of these tasks.

Further reading

  • SVN in Nautilus: Nautilus SVN Integration project page.
  • Nautilus subversion integration tool. Running SVN Commands with Gnome Scripts A tutorial on how to integrate and use SVN in Nautilus.
  • Nautilus File Manager Scripts A page with a nice collection of Nautilus scripts.
  • Nautilus in GNOME Live Nautilus page in GNOME Live.
  • Extending Nautilus A guide on writing scripts and extensions for the Nautilus File Explorer.

Web Browsers

Linux has many web browsers to play with, from the Mozilla family to console-based browsers. They all have their pros and cons. But most of the time, we only need a few to test, probably Firefox, Opera, and one with the WebKit/KHTML engine.

Because I’m covering the GNOME environment, I chose Epiphany, with the WebKit engine (the developers from Epiphany’s project switched from Gecko to WebKit in the latest releases). Epiphany with WebKit is called epiphany-webkit on Debian and probably some other distributions

Epiphany WebKit

If you’re on KDE, however, Chromium probably suits you better because it doesn’t rely on GNOME libraries or even use Konqueror (KHTML).

Note: I’m not a specialist in rendering engines, so I can’t say for sure if testing on newer versions of Konqueror (which uses KHTML) would be sufficient for rendering tests. WebKit. I do all my testing in Epiphany.

If you really need to test your website in Internet Explorer, you can use the Wine library with Wine Tricks. Or use VirtualBox images, which are provided by Microsoft. For now, IE8 on Wine is still too buggy. But IE7 can run on Wine – see the “Further reading” section below for more. Running them in VirtualBox should work just fine.

Further reading

  • Chromium Chromium project page.
  • Epiphany WebKit Epiphany WebKit page on GNOME Live.
  • IE 7 on Wine How to run IE7 on Wine.
  • HOTO: Run IE6, IE7, IE8 on Linux in VirtualBox How to use VirtualBox to run Microsoft browsers. Another guide is here.
  • Wine Tricks Wine Tricks page on the Wine HQ wiki.

Package Manager: Your Best Friend

If there’s one thing I really love in every Linux distro I’ve ever used, it’s package management. Granted, some are better than others, but generally speaking, you only need the command line to take control of your system applications. Package managers help you find, install, and keep track of security updates and new versions of your applications. And you can install more than one app at a time, even if they’re unrelated.

apt-get on action

According to the package manager, when searching for and installing new applications, others are suggested to you that might work well with the ones you’ve found, such as GUIs for configuring and managing an FTP server.

apt-get suggestions

Some packages to install AMP include too many applications (even on Linux) or are strict on what they have packaged.But by using a package manager on Linux, installing a server environment can be easier and more flexible: you can tailor your installation more efficiently, choosing only what you need. Why would you install PHP if you are not a PHP developer? Why install MySQL if SQLite meets your needs? You probably don’t need an FTP server or email service either. However, you can easily install any of them if you need it in the future. Also, you don’t need to be restricted to Apache if you plan to use, say, lighttpd.

Open source version control systems are available for Linux and, even better, in distribution repositories. For Debian, you have Git (as git-core), Mercurial, CVS, Subversion, and Bazaar all in the official repository (although Bazaar is on backports and unstable). No need to go to a bunch of different websites.

apt-get suggestions

Further reading

  • The Perfect Server: Debian Lenny Tips and instructions on how to setting up a full server on Debian
  • Debian lighttpd How to set up a lighttpd server on Debian
  • Gentoo Tutorials A collection of tutorials on the Getoo Wiki. Might be useful for other distributions as well.
  • CrossFTP Server An FTP server with an LDAP/database back-end and GUI configuration/monitoring.
  • GAdmin ProFTPD GAdmin module for manage ProFTPD servers using a graphical user interface.
  • PureAdmin PureAdmin is user and server administration for pure ftpd.

Native multi-paste and multi-desktop

I started using Linux seriously in late 2003 when I got tired of Windows 98 SE freezing after 20 minutes of use and having to reinstall after 2 weeks.

After After installing Debian and exploring KDE features, I discovered how cool and useful the virtual multi-desktop concept was. Now when I use other operating systems, this is what I miss the most. But really understanding how it can help you organize your windows and your work takes some time.

Multiple desktops

Another thing that I find very useful and strange in all the other systems that I use is being able to store in buffer two things to the clipboard with any external tool. (Okay, I know when using Vim you have as many buffers as you have keys, but it would take a whole book to talk about Vim!) All I need to do is highlight a piece of text and press the middle button to paste it. And if I have something in the buffer (pre-loaded with Control + C), I won’t lose it.

Multiple clipboard

It has many options to control multiple buffers on the clipboard. KDE already comes with Klipper, which is great. GNOME doesn’t come with such a tool, but it does have some nice options (I use Parcellite).

Parcelite

One small thing I miss is a native way to call programs without having to do click on their icons or menu entries or call them through the terminal. Both GNOME and KDE have a native application launcher which you can call by pressing Alt + F2. Then just start typing and it will show you your options. Although QuickSilver and similar programs do something similar and even better, you must install it.

Application Launcher

Further reading

  • X Window System Multiple Desktops Wikipedia entry on multiple desktops on the X Window System
  • Glipper A GTK clipboard manager.
  • Parcellite Another GTK clipboard manager.
  • GNOME Launch Box A QuickSilver-like tool for the GNOME environment.
  • GNOME Do Another QuickSilver-inspired tool.
  • KDE Katapult tool inspired by QuickSilver.
  • GNOME Deskbar Deskbar is a bundled applet with GNOME in order to provide a common search interface.

A Note on KDE

Linux is a rich world and has many variables to experiment with. I have never used any of the KDE specific tools. For programming, I use NetBeans. I’ve used KWriter for simple editing but never for programming (nor Kate). Although I haven’t used KDE4, I can say from experience that for file browsing Konqueror is an excellent application: built-in preview for many file types, native access to SSH, (S)FTP and other network protocols, extensible file tabbed navigation and many other great features.

Conclusion

We’ve seen lots of easy tools to play with, a rich environment for creating test and development servers, and a good variety of tools to improve your workflow. Although Linux is not the most popular operating system for desktop computers, it is not necessarily unsuitable for most types of development work, and may even be better than the most popular operating systems. Now it’s up to you to try it out if you’re not satisfied with your current environment.

Further reading

  • Official Vim page Vim
  • Vim doc A project by Vim documentation, with references, tips, FAQs, and tutorials. A good resource for any Vim user.
  • Shlomi Fish’s Vim for Beginners A good place to start if you want to learn Vim.
  • VIM for Django Hints, plugins, and scripts for making Vim be more suitable for Django.
  • Vim for Rails A plugin to improve Vim for Ruby On Rails.

Related Posts

You may be interested in the following related posts:

  • CSS Editors Review This review includes the JustStyle CSS Editor, CSSED, and other CSS editors for Linux.
  • Review of 35 useful source code editors This release includes Komodo Edit, Aptana Studio, Screem, Quanta Plus, Emacs and other editors for Linux.

.

See Also:  How to create a logo in corel paint shop pro

Leave a Reply

Your email address will not be published. Required fields are marked *